149878f5aa8a34bc901f675fa9179f1f0332e9cb
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2011-03-23  Balazs Kelemen  <kbalazs@webkit.org>
2
3         Reviewed by Andreas Kling.
4
5         [WK2] Handle keyboard and mouse events on X11
6         https://bugs.webkit.org/show_bug.cgi?id=56103
7
8         Propagate keyboard and mouse events to the plugin
9         as XEvent's.
10
11         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
12         (WebKit::initializeXEvent):
13         (WebKit::xTimeStamp):
14         (WebKit::xKeyModifiers):
15         (WebKit::setCommonMouseEventFields):
16         (WebKit::setXMotionEventFields):
17         (WebKit::setXButtonEventFields):
18         (WebKit::setXCrossingEventFields):
19         (WebKit::NetscapePlugin::platformHandleMouseEvent):
20         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
21         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
22         (WebKit::setXKeyEventFields):
23         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
24
25 2011-03-23  Anders Carlsson  <andersca@apple.com>
26
27         Reviewed by Sam Weinig.
28
29         Connection::SyncMessageState::processIncomingMessage should ignore whether the message is sync or not
30         https://bugs.webkit.org/show_bug.cgi?id=56954
31
32         This is so we'll eventually be able to send sync messages that aren't processed immediately if the 
33         destination is waiting for a reply to another synchronous message.
34
35         * Platform/CoreIPC/Connection.cpp:
36         (CoreIPC::Connection::SyncMessageState::processIncomingMessage):
37         Only check for the DispatchMessageWhenWaitingForSyncReply flag.
38
39         (CoreIPC::Connection::sendSyncMessage):
40         Add both DispatchMessageWhenWaitingForSyncReply and SyncMessage to the message ID.
41
42         * Platform/CoreIPC/Connection.h:
43         (CoreIPC::Connection::sendSync):        
44         (CoreIPC::Connection::deprecatedSendSync):
45         No need to add SyncMessage here anymore.
46
47 2011-03-23  Brian Weinstein  <bweinstein@apple.com>
48
49         Qt Build Fix.
50
51         * DerivedSources.pro:
52
53 2011-03-22  Brian Weinstein  <bweinstein@apple.com>
54
55         Reviewed by Darin Adler.
56
57         WebKit2: Need API to manage the Media Cache
58         https://bugs.webkit.org/show_bug.cgi?id=56878
59         <rdar://problem/9082503>
60
61         Project File Fun:
62         * GNUmakefile.am:
63         * WebKit2.pri:
64         * WebKit2.pro:
65         * WebKit2.xcodeproj/project.pbxproj:
66         * win/WebKit2.vcproj:
67         * win/WebKit2Common.vsprops:
68         * win/WebKit2Generated.make:
69         
70         Derived Sources and API fun:
71         * DerivedSources.make:
72         * DerivedSources.pro:
73         * Platform/CoreIPC/MessageID.h:
74         * Shared/API/c/WKBase.h:
75         * Shared/APIObject.h:
76         * UIProcess/API/C/WKAPICast.h:
77         
78         * UIProcess/WebProcessProxy.cpp:
79         (WebKit::WebProcessProxy::didReceiveMessage): Add a case for MediaCache messages.
80         * WebProcess/WebProcess.cpp:
81         (WebKit::WebProcess::didReceiveMessage): Ditto.
82         
83         * UIProcess/WebContext.cpp:
84         (WebKit::WebContext::WebContext): Initialize the WebMediaCacheManagerProxy member variable.
85         (WebKit::WebContext::~WebContext): Invalidate the WebMediaCacheManagerProxy.
86         (WebKit::WebContext::disconnectProcess): Ditto.
87         (WebKit::WebContext::didReceiveMessage): Add a case for MediaCache messages.
88         * UIProcess/WebContext.h:
89         (WebKit::WebContext::mediaCacheManagerProxy):
90
91         * UIProcess/API/C/WKContext.cpp:
92         (WKContextGetMediaCacheManager): Returns the context's WebMediaCacheManager.
93         * UIProcess/API/C/WKContext.h:
94
95         * UIProcess/API/C/WKMediaCacheManager.cpp: Added.
96         (WKMediaCacheManagerGetTypeID): Returns the WebMediaCacheManagerProxy type.
97         (WKMediaCacheManagerGetHostnamesWithMediaCache): Calls down to the WebMediaCacheManagerProxy.
98         (WKMediaCacheManagerClearCacheForHostname): Ditto.
99         (WKMediaCacheManagerClearCacheForAllHostnames): Ditto.
100         * UIProcess/API/C/WKMediaCacheManager.h: Added.
101
102         * UIProcess/WebMediaCacheManagerProxy.cpp: Added.
103         (WebKit::WebMediaCacheManagerProxy::create):
104         (WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy):
105         (WebKit::WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy):
106         (WebKit::WebMediaCacheManagerProxy::invalidate):
107         (WebKit::WebMediaCacheManagerProxy::didReceiveMessage):
108         (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache): Call through to the WebProcess.
109         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache): Process the WebProcess response,
110             and call the callback.
111         (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname): Call through to the WebProcess.
112         (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames): Call through to the WebProcess.
113         * UIProcess/WebMediaCacheManagerProxy.h: Added.
114         (WebKit::WebMediaCacheManagerProxy::clearContext):
115         (WebKit::WebMediaCacheManagerProxy::type):
116         * UIProcess/WebMediaCacheManagerProxy.messages.in: Added.
117
118         * WebProcess/MediaCache: Added.
119         * WebProcess/MediaCache/WebMediaCacheManager.cpp: Added.
120         (WebKit::WebMediaCacheManager::shared):
121         (WebKit::WebMediaCacheManager::WebMediaCacheManager):
122         (WebKit::WebMediaCacheManager::didReceiveMessage):
123         (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache): Added a FIXME to call through to WebCore.
124         (WebKit::WebMediaCacheManager::clearCacheForHostname): Ditto.
125         (WebKit::WebMediaCacheManager::clearCacheForAllHostnames): Ditto.
126         * WebProcess/MediaCache/WebMediaCacheManager.h: Added.
127         * WebProcess/MediaCache/WebMediaCacheManager.messages.in: Added.
128
129 2011-03-22  Brady Eidson  <beidson@apple.com>
130
131         Reviewed by Sam Weinig.
132
133         Add asynchronous load decision call to WebKit2 IconDatabase
134         https://bugs.webkit.org/show_bug.cgi?id=56887
135
136         * UIProcess/WebIconDatabase.cpp:
137         (WebKit::WebIconDatabase::getLoadDecisionForIconURL): In the future, get the actual load decision from the database.
138           For now, always message "IconLoadNo" back to the WebProcess.
139         * UIProcess/WebIconDatabase.h:
140         * UIProcess/WebIconDatabase.messages.in:
141         
142         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
143         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): Message the UIProcess for the load decision.
144         (WebKit::WebIconDatabaseProxy::receivedIconLoadDecision): Callback into WebCore with the received load decision.
145         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
146         * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in:
147
148 2011-03-23  Chris Fleizach  <cfleizach@apple.com>
149
150         Reviewed by Darin Adler.
151
152         REGRESSION: WK2: AX: PDF in Safari no longer accessible.
153         https://bugs.webkit.org/show_bug.cgi?id=56849
154
155         The WKView needs to know when to return the WKPDFView and when to return
156         the remote web process connection.
157
158         * UIProcess/API/mac/PDFViewController.h:
159         (WebKit::PDFViewController::pdfView):
160         * UIProcess/API/mac/WKView.mm:
161         (-[WKView accessibilityFocusedUIElement]):
162         (-[WKView accessibilityHitTest:]):
163         (-[WKView accessibilityAttributeValue:]):
164
165 2011-03-21  Stephanie Lewis  <slewis@apple.com>
166
167         Reviewed by Simon Fraser.
168
169         https://bugs.webkit.org/show_bug.cgi?id=56798
170         Wrap autorelease pools around calls that can have pathological memory growth on Membuster.  
171         Only wrap the main runloop because some background threads are not expected to call into 
172         objc and an autorelease pool could mask bugs.
173
174         * Platform/mac/RunLoopMac.mm:
175         (RunLoop::performWork):
176         (RunLoop::TimerBase::timerFired):
177         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
178         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
179
180 2011-03-22  Anders Carlsson  <andersca@apple.com>
181
182         Reviewed by Sam Weinig.
183
184         OBJECT element with DivX source is always downloaded
185         https://bugs.webkit.org/show_bug.cgi?id=56879
186
187         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
188         (WebKit::getPluginInfoFromPropertyLists):
189         Always try to split every element in the "WebPluginExtensions" array, since the DivX plug-in
190         specifies multiple file extensions in a single element.
191         
192         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
193         (WebKit::pluginSupportsExtension):
194         Add a new helper function.
195
196         (WebKit::WebFrameLoaderClient::objectContentType):
197         If we can't find the MIME for an extension, explicitly check if there's a plugin that claims to
198         handle the given extension.
199
200 2011-03-22  Brady Eidson  <beidson@apple.com>
201
202         Reviewed by Sam Weinig.
203
204         Rename the synchronous icon database messages to be prefixed with "synchronous"
205
206         * UIProcess/WebIconDatabase.cpp:
207         (WebKit::WebIconDatabase::synchronousIconDataForPageURL):
208         (WebKit::WebIconDatabase::synchronousIconURLForPageURL):
209         (WebKit::WebIconDatabase::synchronousIconDataKnownForIconURL):
210         (WebKit::WebIconDatabase::synchronousLoadDecisionForIconURL):
211         * UIProcess/WebIconDatabase.h:
212         * UIProcess/WebIconDatabase.messages.in:
213
214         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
215         (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL):
216
217 2011-03-22  Sam Weinig  <sam@webkit.org>
218
219         Rubber-stamped by Anders Carlsson.
220
221         Loading a new tab does not dismiss Lookup
222         <rdar://problem/9138391> 
223
224         * UIProcess/API/mac/WKView.mm:
225         (-[WKView viewDidMoveToWindow]):
226         Hide the dictionary popup when moving the WKView out of a window.
227
228 2011-03-22  Anders Carlsson  <andersca@apple.com>
229
230         Reviewed by Sam Weinig.
231
232         Microsoft Silverlight playback shows artifacts
233         https://bugs.webkit.org/show_bug.cgi?id=56863
234         <rdar://problem/9103136>
235
236         * PluginProcess/PluginControllerProxy.cpp:
237         (WebKit::PluginControllerProxy::paint):
238         If the plug-in is transparent, clear the dirty rect before painting.
239
240         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
241         (WebKit::NetscapePluginModule::determineQuirks):
242         Add the MakeTransparentIfBackgroundAttributeExists quirk for Silverlight plug-ins.
243
244         * Shared/Plugins/PluginQuirks.h:
245         Add MakeTransparentIfBackgroundAttributeExists quirk.
246
247         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
248         (WebKit::NPN_SetValue):
249         Handle NPPVpluginTransparentBool.
250
251         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
252         (WebKit::NetscapePlugin::NetscapePlugin):
253         Initialize m_isTransparent to false.
254
255         (WebKit::NetscapePlugin::setIsTransparent):
256         Set m_isTransparent.
257
258         (WebKit::NetscapePlugin::initialize):
259         If the plug-in has the MakeTransparentIfBackgroundAttributeExists quirk, make it transparent
260         if there's a 'background' attribute.
261
262         (WebKit::NetscapePlugin::isTransparent):
263         Add getter.
264
265         * WebProcess/Plugins/Plugin.h:
266         Add isTransparent().
267
268         * WebProcess/Plugins/PluginProxy.cpp:
269         (WebKit::PluginProxy::paint):
270         Always copy the plug-in backing store to the plug-in proxy backing store.
271
272         (WebKit::PluginProxy::isTransparent):
273         Add getter that should never be called.
274
275         (WebKit::PluginProxy::update):
276         Always copy the plug-in backing store to the plug-in proxy backing store.
277
278 2011-03-22  Anders Carlsson  <andersca@apple.com>
279
280         Reviewed by Sam Weinig.
281
282         Crash when calling PluginProxy::evaluate on a destroyed plug-in
283         https://bugs.webkit.org/show_bug.cgi?id=56848
284         <rdar://problem/9168975>
285
286         Return early if the NPObject doesn't exist anymore.
287
288         * WebProcess/Plugins/PluginProxy.cpp:
289         (WebKit::PluginProxy::evaluate):
290
291 2011-03-22  Sam Weinig  <sam@webkit.org>
292
293         Reviewed by Adam Roben.
294
295         WebKit2: Cannot make a selection past the end of the visible page (no autoscrolling)
296         <rdar://problem/8823874>
297         https://bugs.webkit.org/show_bug.cgi?id=56847
298
299         * Shared/mac/WebEventFactory.mm:
300         (WebKit::currentMouseButton):
301         (WebKit::mouseButtonForEvent):
302         Add mouse button for mouseEnter/Exit events. [NSEvent buttonNumber] doesn't seem to give the right result
303         for these events, but getting the currentMouseButton does work.
304
305 2011-03-21  Brady Eidson  <beidson@apple.com>
306
307         Fix Mac release builds after https://bugs.webkit.org/show_bug.cgi?id=56783
308
309         * Platform/mac/Logging.mac.mm:
310
311 2011-03-21  Brady Eidson  <beidson@apple.com>
312
313         Reviewed by Brian Weinstein.
314
315         https://bugs.webkit.org/show_bug.cgi?id=56783
316         Actually hook up WebKit2 logging on Mac.
317
318         * Platform/Logging.cpp:
319         (WebKit::initializeLogChannel):
320         * Platform/Logging.h:
321         * Platform/mac/Logging.mac.mm: Added.
322         (WebKit::initializeLogChannel):
323  
324        * UIProcess/WebContext.cpp:
325         (WebKit::WebContext::WebContext): Initialize logging if necessary.
326
327         * WebKit2.xcodeproj/project.pbxproj:
328
329 2011-03-21  Alexey Proskuryakov  <ap@apple.com>
330
331         Reviewed by Darin Adler.
332
333         REGRESSION (r81269): WebKit2 gets into an infinite recursion after an unhandled command key
334         https://bugs.webkit.org/show_bug.cgi?id=56782
335         <rdar://problem/9151993>
336
337         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::doneWithKeyEvent):
338         Factored out code for resending an event and moved it to WKView.
339
340         * UIProcess/API/mac/WKView.mm:
341         (-[WKView performKeyEquivalent:]): Don't zero out _keyDownEventBeingResent, it's easier
342         to just do that in _resendKeyDownEvent:.
343         (-[WKView keyDown:]): Ditto.
344         (-[WKView _resendKeyDownEvent:]): Moved from PageClientImpl.mm. Added an assertion that we
345         are not already resending an event - it would be too confusing if we ever had to do that,
346         but looks like this never happens.
347
348         * UIProcess/API/mac/WKViewInternal.h: Exposed _resendKeyDownEvent.
349
350 2011-03-21  Anders Carlsson  <andersca@apple.com>
351
352         Reviewed by Sam Weinig.
353
354         QT plug-in fails to load contextual menu
355         https://bugs.webkit.org/show_bug.cgi?id=56777
356         <rdar://problem/8979033>
357
358         Open a Carbon resource map and make it the current map when calling NP_Initialize.
359
360         * Platform/Module.cpp:
361         (WebKit::Module::Module):
362         Initialize m_bundleResourceMap to -1.
363
364         * Platform/Module.h:
365         Add m_bundleResourceMap.
366
367         * Platform/mac/ModuleMac.mm:
368         (WebKit::Module::unload):
369         Close the resource map.
370
371         (WebKit::Module::bundleResourceMap):
372         Open a resource map if necessary.
373
374         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
375         (WebKit::NetscapePluginModule::tryLoad):
376         Get the resource map and make it current before calling NP_Initialize.
377
378 2011-03-21  Anders Carlsson  <andersca@apple.com>
379
380         Reviewed by Sam Weinig.
381
382         Plug-in process crashes if it fails to load a plug-in module
383         https://bugs.webkit.org/show_bug.cgi?id=56775
384
385         * PluginProcess/PluginControllerProxy.cpp:
386         (WebKit::PluginControllerProxy::initialize):
387         If NetscapePlugin::create returns null, call removePluginControllerProxy with a null plug-in.
388
389         * PluginProcess/WebProcessConnection.cpp:
390         (WebKit::WebProcessConnection::removePluginControllerProxy):
391         Remove an incorrect assertion. Don't invalidate the remote object map if the plug-in is null.
392
393 2011-03-21  Anders Carlsson  <andersca@apple.com>
394
395         Reviewed by Sam Weinig.
396
397         QT plug-in loads controller at top of movie not bottom
398         https://bugs.webkit.org/show_bug.cgi?id=56764
399         <rdar://problem/8979037>
400
401         Create a layer with geometryFlipped set and add the plug-in layer as a sublayer,
402         matching WebKit1.
403
404         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
405         (WebKit::NetscapePlugin::platformPostInitialize):
406
407 2011-03-21  Sam Weinig  <sam@webkit.org>
408
409         Reviewed by Anders Carlsson.
410
411         WebKit2 needs preferences to change security knobs
412         https://bugs.webkit.org/show_bug.cgi?id=56762
413
414         Add preferences for WebSecurityEnabled, UniversalAccessFromFileURLsAllowed
415         and FileAccessFromFileURLsAllowed.
416
417         * Shared/WebPreferencesStore.h:
418         * UIProcess/API/C/WKPreferences.cpp:
419         (WKPreferencesSetWebSecurityEnabled):
420         (WKPreferencesGetWebSecurityEnabled):
421         (WKPreferencesSetUniversalAccessFromFileURLsAllowed):
422         (WKPreferencesGetUniversalAccessFromFileURLsAllowed):
423         (WKPreferencesSetFileAccessFromFileURLsAllowed):
424         (WKPreferencesGetFileAccessFromFileURLsAllowed):
425         * UIProcess/API/C/WKPreferencesPrivate.h:
426         * WebProcess/WebPage/WebPage.cpp:
427         (WebKit::WebPage::updatePreferences):
428
429 2011-03-21  Sam Weinig  <sam@webkit.org>
430
431         Reviewed by Anders Carlsson.
432
433         Remove old DrawingArea and LayerHostingView code from WKView.
434
435         * UIProcess/API/mac/WKView.mm:
436         (-[WKView drawRect:]):
437         (-[WKView hitTest:]):
438         (-[WKView WebKit::]):
439
440 2011-03-21  Sam Weinig  <sam@webkit.org>
441
442         Reviewed by Anders Carlsson.
443
444         Need WebKit2 API for creating a page with a specific main frame name
445         https://bugs.webkit.org/show_bug.cgi?id=56759
446
447         * Shared/WebPageCreationParameters.cpp:
448         (WebKit::WebPageCreationParameters::encode):
449         (WebKit::WebPageCreationParameters::decode):
450         * Shared/WebPageCreationParameters.h:
451         Add mainFrameName to creation parameters.
452
453         * UIProcess/API/mac/WKView.h:
454         * UIProcess/API/mac/WKView.mm:
455         (-[WKView initWithFrame:]):
456         (-[WKView initWithFrame:contextRef:]):
457         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
458         (-[WKView initWithFrame:contextRef:pageGroupRef:mainFrameName:]):
459         Add new initializer which takes a main frame name.
460
461         * UIProcess/WebPageProxy.cpp:
462         (WebKit::WebPageProxy::setMainFrameName):
463         (WebKit::WebPageProxy::creationParameters):
464         * UIProcess/WebPageProxy.h:
465         Store the main frame name for initialization/re-initialization.
466
467         * WebProcess/WebPage/WebFrame.cpp:
468         (WebKit::WebFrame::createMainFrame):
469         * WebProcess/WebPage/WebFrame.h:
470         * WebProcess/WebPage/WebPage.cpp:
471         (WebKit::WebPage::WebPage):
472         Pass the name to main frame creation.
473
474 2011-03-20  Bill Budge  <bbudge@chromium.org>
475
476         Reviewed by Adam Barth.
477
478         Rename ThreadSafeShared to ThreadSafeRefCounted
479         https://bugs.webkit.org/show_bug.cgi?id=56714
480
481         No new tests. Exposes no new functionality.
482
483         * Platform/CoreIPC/Connection.h:
484         * Platform/WorkQueue.h:
485         * Platform/win/WorkQueueWin.cpp:
486         * UIProcess/Launcher/ProcessLauncher.h:
487         * UIProcess/Launcher/ThreadLauncher.h:
488
489 2011-03-19  Anton D'Auria  <adauria@apple.com>
490
491         Reviewed by Alexey Proskuryakov.
492
493         ApplicationCacheGroup is not obsolete after being deleted via ApplicationCacheStorage::deleteEntriesForOrigin
494         https://bugs.webkit.org/show_bug.cgi?id=56415
495
496         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp: calling ApplicationCacheGroup::deleteCacheGroupsForOrigin
497         instead of ApplicationCacheStorage::deleteEntriesForOrigin.
498         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
499
500 2011-03-18  Sam Weinig  <sam@webkit.org>
501
502         Attempt to fix the WinCairo build.
503
504         * win/WebKit2.vcproj:
505
506 2011-03-18  Anders Carlsson  <andersca@apple.com>
507
508         Reviewed by Dan Bernstein.
509
510         Empty gray page after going back from a PDF
511         https://bugs.webkit.org/show_bug.cgi?id=56694
512         <rdar://problem/8811854>
513
514         Update m_frameHasCustomRepresentation when loading a page that's in the page cache.
515
516         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
517         (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
518
519 2011-03-18  Anders Carlsson  <andersca@apple.com>
520
521         Reviewed by Sam Weinig.
522
523         Crash when sending a sync message ends up invalidating the connection
524         https://bugs.webkit.org/show_bug.cgi?id=56686
525         <rdar://problem/9048781>
526
527         Guard against a null client.
528
529         * Platform/CoreIPC/Connection.cpp:
530         (CoreIPC::Connection::sendSyncMessage):
531
532 2011-03-18  Balazs Kelemen  <kbalazs@webkit.org>
533
534         Reviewed by Benjamin Poulain.
535
536         [Qt][WK2] Need a way to debug the web process after the UI process dies
537         https://bugs.webkit.org/show_bug.cgi?id=56116
538
539         Allow the web process to outlive it's parent process
540         in debug builds if the QT_WEBKIT_KEEP_ALIVE_WEB_PROCESS
541         environment variable is set.
542
543         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
544         (WebKit::QtWebProcess::setupChildProcess): Used getenv
545         since the prctl call is already in a Linux-only block
546         and the implementation in this file is a candidate
547         for sharing across ports in the future.
548
549 2011-03-18  Darin Adler  <darin@apple.com>
550
551         Reviewed by Anders Carlsson.
552
553         Command-period does not stop load when page has focus in WebKit2
554         https://bugs.webkit.org/show_bug.cgi?id=56601
555
556         * UIProcess/API/mac/WKView.mm:
557         (-[WKView doCommandBySelector:]): If called outside interpretKeyEvents,
558         call through to super.
559         (-[WKView insertText:]): Assert that we are inside interpretKeyEvents.
560         (-[WKView unmarkText]): Ditto.
561         (-[WKView setMarkedText:selectedRange:]): Ditto.
562         (-[WKView _interceptKeyEvent:]): Set a flag to indicate we are inside
563         interpretKeyEvents for use by the above.
564
565 2011-03-18  Brady Eidson  <beidson@apple.com>
566
567         Reviewed by Sam Weinig.
568
569         https://bugs.webkit.org/show_bug.cgi?id=56425
570         More groundwork for WebKit2 IconDatabase
571
572         -Update the synchronous method names to be prefixed with "synchronous."
573         -Add empty implementations for the asynchronous accessors.
574
575         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
576         (WebKit::WebIconDatabaseProxy::setEnabled):
577         (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL):
578         (WebKit::WebIconDatabaseProxy::synchronousIconURLForPageURL):
579         (WebKit::WebIconDatabaseProxy::synchronousIconDataKnownForIconURL):
580         (WebKit::WebIconDatabaseProxy::synchronousLoadDecisionForIconURL):
581         (WebKit::WebIconDatabaseProxy::supportsAsynchronousMode):
582         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL):
583         (WebKit::WebIconDatabaseProxy::iconDataForIconURL):
584         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
585
586 2011-03-18  Alejandro G. Castro  <alex@igalia.com>
587
588         Reviewed by Martin Robinson.
589
590         Fixed compilation after r80925.
591
592         * GNUmakefile.am:
593         * UIProcess/gtk/WebFullScreenManagerProxyGtk.cpp: Added.
594         (WebKit::WebFullScreenManagerProxy::enterFullScreen):
595         (WebKit::WebFullScreenManagerProxy::exitFullScreen):
596         (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation):
597         (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation):
598         (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation):
599         (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation):
600         (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode):
601         (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode):
602         (WebKit::WebFullScreenManagerProxy::getFullScreenRect):
603         * WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.cpp: Added.
604         (WebKit::WebFullScreenManagerGtk::WebFullScreenManagerGtk):
605         (WebKit::WebFullScreenManager::create):
606         (WebKit::WebFullScreenManagerGtk::setRootFullScreenLayer):
607         (WebKit::WebFullScreenManagerGtk::beginEnterFullScreenAnimation):
608         (WebKit::WebFullScreenManagerGtk::beginExitFullScreenAnimation):
609         * WebProcess/FullScreen/gtk/WebFullScreenManagerGtk.h: Added.
610
611 2011-03-18  Alejandro G. Castro  <alex@igalia.com>
612
613         Unreviewed, fixed compilation after r81208.
614
615         * GNUmakefile.am:
616
617 2011-03-18  John Sullivan  <sullivan@apple.com>
618
619         Reviewed by Dan Bernstein.
620
621         https://bugs.webkit.org/show_bug.cgi?id=56645
622         Assertion fires when hidden Find-on-Page matches are encountered in WebKit2
623
624         * WebProcess/WebPage/FindController.cpp:
625         (WebKit::FindController::updateFindIndicator):
626         Bail out if the selection rect is empty, before trying to generate an appropriately-sized
627         bitmap. (Previously it was bailing out afterwards, but encountering an assertion in debug
628         builds along the way.)
629
630 2011-03-18  Mark Rowe  <mrowe@apple.com>
631
632         Rubber-stamped by Jon Honeycutt.
633
634         <rdar://problem/9153929> PluginProcess fails to launch due to PluginProcessShim.dylib building for 64-bit only
635
636         Fix a bogus change from r81392 that made PluginProcessShim.xcconfig import DebugRelease.xcconfig.
637         As its name suggests, DebugRelease.xcconfig is only applicable for the debug and release configurations.
638         It overrides the valid build architectures and also restricts the build to only the active architecture.
639         
640         * Configurations/PluginProcessShim.xcconfig: Import BaseTarget.xcconfig instead. This is what
641         each target-specific .xcconfig file should import.
642
643 2011-03-17  Mark Rowe  <mrowe@apple.com>
644
645         Fix the build.
646
647         * WebKit2.xcodeproj/project.pbxproj:
648
649 2011-03-17  Anders Carlsson  <andersca@apple.com>
650
651         Reviewed by Sam Weinig.
652
653         Implement PluginProcessProxy::setFullscreenWindowIsShowing
654         https://bugs.webkit.org/show_bug.cgi?id=56618
655
656         * UIProcess/Plugins/PluginProcessProxy.cpp:
657         (WebKit::PluginProcessProxy::PluginProcessProxy):
658         Initialize m_fullscreenWindowIsShowing.
659
660         (WebKit::PluginProcessProxy::didClose):
661         if m_fullscreenWindowIsShowing is true, call exitFullscreen.
662
663         * UIProcess/Plugins/PluginProcessProxy.h:
664         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
665         (WebKit::PluginProcessProxy::getPluginProcessSerialNumber):
666         Add helper function for getting a PSN for the plug-in process.
667
668         (WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess):
669         Make the plug-in process the front process.
670
671         (WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess):
672         Make the current process (the UI process) the front process.
673
674         (WebKit::PluginProcessProxy::setFullscreenWindowIsShowing):
675         Call enterFullscreen or exitFullscreen.
676
677         (WebKit::PluginProcessProxy::enterFullscreen):
678         Make the plug-in process the front process and hide the menu bar.
679
680         (WebKit::PluginProcessProxy::exitFullscreen):
681         Show the menu bar and if necessary make the UI process the front process.
682
683         (WebKit::PluginProcessProxy::endModal):
684         call makeUIProcessTheFrontProcess.
685
686         (WebKit::PluginProcessProxy::applicationDidBecomeActive):
687         Call makePluginProcessTheFrontProcess.
688
689 2011-03-17  Adam Roben  <aroben@apple.com>
690
691         Make bidi text in <select> menus in WebKit2 on Windows match WebKit1
692
693         Fixes <http://webkit.org/b/56614> 3 <select> bidi tests failing on Windows 7 Release
694         (WebKit2 Tests)
695
696         Reviewed by Sam Weinig.
697
698         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
699         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
700         (WebKit::WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection):
701         On Windows, return the same values we return in WebKit1.
702
703 2011-03-17  Anders Carlsson  <andersca@apple.com>
704
705         Reviewed by Sam Weinig.
706
707         Implement PluginProcessProxy::setModalWindowIsShowing
708         https://bugs.webkit.org/show_bug.cgi?id=56615
709
710         * UIProcess/Plugins/PluginProcessProxy.cpp:
711         (WebKit::PluginProcessProxy::PluginProcessProxy):
712         Initialize m_modalWindowIsShowing.
713
714         (WebKit::PluginProcessProxy::didClose):
715         If m_modalWindowIsShowing is true, we must call endModal.
716
717         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
718         (-[WKPlaceholderModalWindow _wantsUserAttention]):
719         Add a WKPlaceholderModalWindow.
720
721         (WebKit::PluginProcessProxy::setModalWindowIsShowing):
722         Call beginModal or endModal depending on whether we're showing a modal window or not.
723
724         (WebKit::PluginProcessProxy::beginModal):
725         Create a fake window and start a nested run loop. Listen for NSApplicationWillBecomeActiveNotification notifications.
726
727         (WebKit::PluginProcessProxy::endModal):
728         Tear down the window and the run loop.
729
730         (WebKit::PluginProcessProxy::applicationDidBecomeActive):
731         Make sure that the plug-in process is frontmost.
732
733 2011-03-17  Jeff Miller  <jeffm@apple.com>
734
735         Reviewed by Adam Roben.
736
737         Web page shouldn't swallow alt-key combinations on Windows
738         https://bugs.webkit.org/show_bug.cgi?id=56612
739         
740         Make Alt+Left Arrow and Alt+Right Arrow go back and forward, but make
741         sure any alt-key combinations bubble up to the client.
742
743         * WebProcess/WebPage/win/WebPageWin.cpp:
744         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Make Alt+Left Arrow and Alt+Right Arrow go back and forward, ignore any other alt-key combinations.
745
746 2011-03-17  Anders Carlsson  <andersca@apple.com>
747
748         Reviewed by Sam Weinig.
749
750         Send SetModalWindowIsShowing and SetFullscreenWindowIsShowing messages to the UI process
751         https://bugs.webkit.org/show_bug.cgi?id=56610
752
753         * PluginProcess/mac/PluginProcessMac.mm:
754         (WebKit::FullscreenWindowTracker::FullscreenWindowTracker):
755         Add fullscreen window tracker class.
756
757         (WebKit::rectCoversAnyScreen):
758         Return whether the given rect covers any screen.
759
760         (WebKit::windowCoversAnyScreen):
761         Return whether the given window covers any screen.
762
763         (WebKit::FullscreenWindowTracker::windowShown):
764         If we're showing a fullscreen window, call PluginProcess::setFullscreenWindowIsShowing.
765
766         (WebKit::FullscreenWindowTracker::windowHidden):
767         If we're hiding the last fullscreen window, call PluginProcess::setFullscreenWindowIsShowing.
768
769         (WebKit::cocoaWindowShown):
770         (WebKit::cocoaWindowHidden):
771         (WebKit::carbonWindowShown):
772         (WebKit::carbonWindowHidden):
773         Call the window tracking functions.
774
775         (WebKit::setModal):
776         Call PluginProcess::setModalWindowIsShowing.
777
778         (WebKit::PluginProcess::setModalWindowIsShowing):
779         (WebKit::PluginProcess::setFullscreenWindowIsShowing):
780         Send CoreIPC messages.
781
782         * UIProcess/Plugins/PluginProcessProxy.h:
783         * UIProcess/Plugins/PluginProcessProxy.messages.in:
784         Add new messages.
785
786         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
787         (WebKit::PluginProcessProxy::setModalWindowIsShowing):
788         (WebKit::PluginProcessProxy::setFullscreenWindowIsShowing):
789         Add stubs.
790
791 2011-03-17  Sam Weinig  <sam@webkit.org>
792
793         Reviewed by Brady Eidson.
794
795         Allow passing a certificate chain as a user message
796         <rdar://problem/8951709>
797         https://bugs.webkit.org/show_bug.cgi?id=56605
798
799         * Shared/API/c/mac/WKCertificateInfoMac.h:
800         * Shared/API/c/mac/WKCertificateInfoMac.mm:
801         (WKCertificateInfoCreateWithCertficateChain):
802         Added. Creates a WKCertificate from a certificate chain.
803
804         * Shared/UserMessageCoders.h:
805         (WebKit::UserMessageEncoder::baseEncode):
806         (WebKit::UserMessageDecoder::baseDecode):
807         Add encoding/decoding of WebCertificateInfo.
808
809 2011-03-17  Anders Carlsson  <andersca@apple.com>
810
811         Reviewed by Sam Weinig.
812
813         Add PluginProcessShim hooks for when windows are shown and hidden
814         https://bugs.webkit.org/show_bug.cgi?id=56597
815
816         * Configurations/PluginProcessShim.xcconfig:
817         Add HEADER_SEARCH_PATHS so we can find WebKitSystemInterface.h.
818
819         * PluginProcess/mac/PluginProcessMac.mm:
820         (WebKit::cocoaWindowShown):
821         (WebKit::cocoaWindowHidden):
822         (WebKit::carbonWindowShown):
823         (WebKit::carbonWindowHidden):
824         (WebKit::setModal):
825         (WebKit::PluginProcess::initializeShim):
826         Add empty stubs.
827
828         * PluginProcess/mac/PluginProcessShim.h:
829         * PluginProcess/mac/PluginProcessShim.mm:
830         (WebKit::beginModal):
831         (WebKit::endModal):
832         Keep a modal count and call setModal accordingly.
833
834         (WebKit::shim_NSApplication_RunModalForWindow):
835         (WebKit::shimModalDialog):
836         (WebKit::shimAlert):
837         Call beginModal/endModal.
838
839         (WebKit::shimShowWindow):
840         (WebKit::shimHideWindow):
841         Call the shim functions.
842         
843         (WebKit::WebKitPluginProcessShimInitialize):
844         Listen for notifications and call the necessary shim functions.
845
846         * WebKit2.xcodeproj/project.pbxproj:
847         Link the plug-in process shim with AppKit and QuartzCore and WKSI.
848
849 2011-03-17  Jeff Miller  <jeffm@apple.com>
850
851         Use a consistent set of file patterns in the svn:ignore property for all .xcodeproj directories, specifically:
852         
853         *.mode*
854         *.pbxuser
855         *.perspective*
856         project.xcworkspace
857         xcuserdata
858
859         * WebKit2.xcodeproj: Modified property svn:ignore.
860
861 2011-03-17  Sam Weinig  <sam@webkit.org>
862
863         Reviewed by Anders Carlsson.
864
865         WKErrors need the PeerCertificateChain for certificate errors
866         <rdar://problem/8951784>
867         https://bugs.webkit.org/show_bug.cgi?id=56592
868
869         * Shared/WebCoreArgumentCoders.h:
870         Special case encoding/decoding of ResourceErrors for the mac.
871
872         * Shared/mac/PlatformCertificateInfo.h:
873         * Shared/mac/PlatformCertificateInfo.mm:
874         (WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
875         Add constructor that take the PeerCertificateChain as CFArrayRef.
876
877         * Shared/mac/WebCoreArgumentCodersMac.mm:
878         (CoreIPC::encodeResourceError):
879         (CoreIPC::decodeResourceError):
880         Add encode/decode for ResourceError using the underlying NSError
881         and encoding/decoding as much of the userInfo as we know how to.
882         Right now this includes all string values and the PeerCertificateChain.
883
884 2011-03-17  John Sullivan  <sullivan@apple.com>
885
886         Reviewed by Adam Roben.
887
888         https://bugs.webkit.org/show_bug.cgi?id=56574
889         Dealloc'ing a WKView can leave a stale reference to it in NSWindow
890
891         * UIProcess/API/mac/WKView.mm:
892         (-[WKView viewWillMoveToWindow:]):
893         Clear the outgoing window's growBoxOwner if it is this view.
894
895 2011-03-17  Anders Carlsson  <andersca@apple.com>
896
897         Rubber-stamped by John Sullivan.
898
899         Rename PluginProcessShim.cpp to PluginProcessShim.mm.
900
901         * PluginProcess/mac/PluginProcessShim.cpp: Removed.
902         * PluginProcess/mac/PluginProcessShim.mm: Copied from PluginProcess/mac/PluginProcessShim.cpp.
903         * WebKit2.xcodeproj/project.pbxproj:
904
905 2011-03-17  Anders Carlsson  <andersca@apple.com>
906
907         Reviewed by Darin Adler.
908
909         Invalidate all NPObjects for a plug-in when that plug-in is destroyed
910         https://bugs.webkit.org/show_bug.cgi?id=56511
911         <rdar://problem/8993491>
912
913         Before this change, we would invalidate NPObjectProxy objects and delete NPObjectMessageReceiver
914         objects when the last plug-in of a certain type was destroyed. Doing so caused us to hold on to memory
915         which we don't need, and could also lead to crashes if the NPObjectMessageReceiver would get a message and
916         tried to invoke it on a already deallocated NPObject.
917
918         * PluginProcess/PluginControllerProxy.cpp:
919         (WebKit::PluginControllerProxy::initialize):
920         If we fail to initialize, call removePluginControllerProxy instead of having WebProcessConnection do so.
921
922         (WebKit::PluginControllerProxy::destroy):
923         Pass the plug-in to removePluginControllerProxy.
924
925         * PluginProcess/WebProcessConnection.cpp:
926         (WebKit::WebProcessConnection::removePluginControllerProxy):
927         Call NPRemoteObjectMap::pluginDestroyed when the plug-in has been destroyed.
928
929         (WebKit::WebProcessConnection::createPlugin):
930         Don't call removePluginControllerProxy if the plug-in fails to initialize. PluginControllerProxy::initialize now
931         takes care of doing this.
932
933         * Shared/Plugins/NPObjectMessageReceiver.cpp:
934         (WebKit::NPObjectMessageReceiver::NPObjectMessageReceiver):
935         (WebKit::NPObjectMessageReceiver::~NPObjectMessageReceiver):
936         * Shared/Plugins/NPObjectMessageReceiver.h:
937         Remove m_shouldReleaseObjectWhenInvalidating, we now know that no NPObjects will have been deallocated
938         by the time the NPObjectMessageReceiver is destroyed.
939
940         (WebKit::NPObjectMessageReceiver::plugin):
941         Add getter.
942         
943         * Shared/Plugins/NPObjectProxy.h:
944         (WebKit::NPObjectProxy::plugin):
945         Add getter.
946         
947         * Shared/Plugins/NPRemoteObjectMap.cpp:
948         (WebKit::NPRemoteObjectMap::NPRemoteObjectMap):
949         Remove m_isInvalidating.
950
951         (WebKit::NPRemoteObjectMap::npObjectProxyDestroyed):
952         Simplify code.
953
954         (WebKit::NPRemoteObjectMap::pluginDestroyed):
955         Rename invalidate to pluginDestroyed. Only invalidate/delete objects that belong to the given plug-in.
956
957         * Shared/Plugins/NPRemoteObjectMap.h:
958         Remove m_isInvalidating.
959         
960         * WebProcess/Plugins/PluginProcessConnection.cpp:
961         (WebKit::PluginProcessConnection::removePluginProxy):
962         Call NPRemoteObjectMap::pluginDestroyed when the plug-in has been destroyed.
963
964 2011-03-17  Oleg Romashin  <oleg.romashin@nokia.com>
965
966         Reviewed by Anders Carlsson.
967
968         Teach WebKit2 messages.py generator to ifdef headers include
969         which are related to ifdef-ed methods/types
970         https://bugs.webkit.org/show_bug.cgi?id=55658
971
972         * Scripts/webkit2/messages.py:
973         * Scripts/webkit2/messages_unittest.py:
974
975 2011-03-16  Joseph Pecoraro  <joepeck@webkit.org>
976
977         Reviewed by Kenneth Rohde Christiansen.
978
979         Viewport no longer allows an auto value for "user-scalable"
980         https://bugs.webkit.org/show_bug.cgi?id=55416
981
982         Make the default value for userScalable be true.
983
984         * UIProcess/API/qt/qwkpage.cpp:
985         (QWKPage::viewportAttributesForSize):
986
987 2011-03-16  Anders Carlsson  <andersca@apple.com>
988
989         Reviewed by Dan Bernstein.
990
991         NPObjectProxy and NPObjectMessageReceiver objects should know their Plugin object
992         https://bugs.webkit.org/show_bug.cgi?id=56506
993
994         * PluginProcess/PluginControllerProxy.cpp:
995         (WebKit::PluginControllerProxy::windowScriptNPObject):
996         (WebKit::PluginControllerProxy::pluginElementNPObject):
997         (WebKit::PluginControllerProxy::evaluate):
998         (WebKit::PluginControllerProxy::getPluginScriptableNPObject):
999         * Shared/Plugins/NPObjectMessageReceiver.cpp:
1000         (WebKit::NPObjectMessageReceiver::create):
1001         (WebKit::NPObjectMessageReceiver::NPObjectMessageReceiver):
1002         (WebKit::NPObjectMessageReceiver::invoke):
1003         (WebKit::NPObjectMessageReceiver::invokeDefault):
1004         (WebKit::NPObjectMessageReceiver::getProperty):
1005         (WebKit::NPObjectMessageReceiver::setProperty):
1006         (WebKit::NPObjectMessageReceiver::construct):
1007         * Shared/Plugins/NPObjectMessageReceiver.h:
1008         * Shared/Plugins/NPObjectProxy.cpp:
1009         (WebKit::NPObjectProxy::create):
1010         (WebKit::NPObjectProxy::NPObjectProxy):
1011         (WebKit::NPObjectProxy::invalidate):
1012         (WebKit::NPObjectProxy::initialize):
1013         (WebKit::NPObjectProxy::invoke):
1014         (WebKit::NPObjectProxy::invokeDefault):
1015         (WebKit::NPObjectProxy::getProperty):
1016         (WebKit::NPObjectProxy::setProperty):
1017         (WebKit::NPObjectProxy::construct):
1018         * Shared/Plugins/NPObjectProxy.h:
1019         * Shared/Plugins/NPRemoteObjectMap.cpp:
1020         (WebKit::NPRemoteObjectMap::createNPObjectProxy):
1021         (WebKit::NPRemoteObjectMap::registerNPObject):
1022         (WebKit::NPRemoteObjectMap::npVariantToNPVariantData):
1023         (WebKit::NPRemoteObjectMap::npVariantDataToNPVariant):
1024         * Shared/Plugins/NPRemoteObjectMap.h:
1025         * WebProcess/Plugins/PluginProxy.cpp:
1026         (WebKit::PluginProxy::pluginScriptableNPObject):
1027         (WebKit::PluginProxy::getWindowScriptNPObject):
1028         (WebKit::PluginProxy::getPluginElementNPObject):
1029         (WebKit::PluginProxy::evaluate):
1030
1031 2011-03-16  Beth Dakin  <bdakin@apple.com>
1032
1033         Reviewed by Darin Adler.
1034
1035         Fix for https://bugs.webkit.org/show_bug.cgi?id=54987 Crash beneath 
1036         WebPageProxy::viewWillStartLiveResize when resizing window after web process 
1037         crashed
1038         -and corresponding-
1039         <rdar://problem/9037685>
1040
1041         Just need simple isValid() checks here. 
1042         * UIProcess/WebPageProxy.cpp:
1043         (WebKit::WebPageProxy::initializeUIClient):
1044         (WebKit::WebPageProxy::viewWillStartLiveResize):
1045         (WebKit::WebPageProxy::viewWillEndLiveResize):
1046
1047 2011-03-16  Damian Kaleta  <dkaleta@apple.com>
1048
1049         Reviewed by Kevin Decker.
1050
1051         Add a user default that will force all plugins to opt in to non-executable data
1052         https://bugs.webkit.org/show_bug.cgi?id=56487
1053         <rdar://problem/9109095>
1054
1055         * UIProcess/Plugins/PluginProcessProxy.cpp:
1056         (WebKit::PluginProcessProxy::PluginProcessProxy):
1057         * UIProcess/Plugins/PluginProcessProxy.h:
1058         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1059         (WebKit::PluginProcessProxy::pluginNeedsExecutableHeap):
1060
1061 2011-03-16  Chris Fleizach  <cfleizach@apple.com>
1062
1063         Reviewed by Darin Adler.
1064
1065         WK2: Need to propagate enhanced accessibility flag from UI -> web process
1066         https://bugs.webkit.org/show_bug.cgi?id=56379
1067
1068         Support sending the enhanced accessibility flag between processes.
1069
1070         * UIProcess/WebContext.cpp:
1071         (WebKit::WebContext::~WebContext):
1072         (WebKit::WebContext::setEnhancedAccessibility):
1073         * UIProcess/WebContext.h:
1074         * UIProcess/gtk/WebContextGtk.cpp:
1075         (WebKit::WebContet::platformInvalidateContext):
1076         * UIProcess/mac/WebContextMac.mm:
1077         (WebKit::WebContext::platformInitializeWebProcess):
1078         (WebKit::WebContext::platformInvalidateContext):
1079         * UIProcess/qt/WebContextQt.cpp:
1080         (WebKit::WebContext::platformInvalidateContext):
1081         * UIProcess/win/WebContextWin.cpp:
1082         (WebKit::WebContext::platformInvalidateContext):
1083         * WebProcess/WebProcess.cpp:
1084         (WebKit::WebProcess::setEnhancedAccessibility):
1085         * WebProcess/WebProcess.h:
1086         * WebProcess/WebProcess.messages.in:
1087
1088 2011-03-15  Oliver Hunt  <oliver@apple.com>
1089
1090         Reviewed by Geoffrey Garen.
1091
1092         Make Structure creation require a JSGlobalData
1093         https://bugs.webkit.org/show_bug.cgi?id=56438
1094
1095         Mechanical change to make all Structure creation use a JSGlobalData&.
1096
1097         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
1098         (WebKit::JSNPMethod::JSNPMethod):
1099         * WebProcess/Plugins/Netscape/JSNPMethod.h:
1100         (WebKit::JSNPMethod::createStructure):
1101         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1102         (WebKit::JSNPObject::JSNPObject):
1103         * WebProcess/Plugins/Netscape/JSNPObject.h:
1104         (WebKit::JSNPObject::createStructure):
1105
1106 2011-03-16  Alexey Proskuryakov  <ap@apple.com>
1107
1108         Reviewed by Dan Bernstein.
1109
1110         WebKit2: Sometimes Command-[ opens a new tab and loads the back page in it
1111         https://bugs.webkit.org/show_bug.cgi?id=56477
1112         <rdar://problem/8806664>
1113
1114         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::doneWithKeyEvent):
1115         Set NSApplication current event when re-dispatching a key event that returned from the web
1116         process unhandled. That way, code that looks at current event modifiers won't be confused.
1117
1118 2011-03-16  Sam Weinig  <sam@webkit.org>
1119
1120         Reviewed by Adam Roben.
1121
1122         Add WebKit2 API to figure out if an input or textarea was edited
1123         https://bugs.webkit.org/show_bug.cgi?id=56474
1124
1125         Expose WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit and
1126         WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit. Next time,
1127         I will work on giving these functions longer names.
1128
1129         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1130         (WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit):
1131         (WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit):
1132         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
1133         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1134         (WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit):
1135         (WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit):
1136         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
1137
1138 2011-03-16  Brady Eidson  <beidson@apple.com>
1139
1140         Reviewed by Adam Roben.
1141
1142         https://bugs.webkit.org/show_bug.cgi?id=56467
1143         IconDatabase-related crash seen in WK2 tests
1144
1145         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1146         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL): The IconLoader might set a null data for an icon, so handle that case.
1147
1148 2011-03-16  Benjamin Poulain  <benjamin.poulain@nokia.com>
1149
1150         Reviewed by Kenneth Rohde Christiansen.
1151
1152         [Qt][WK2] Loading an empty URL crashes
1153         https://bugs.webkit.org/show_bug.cgi?id=55501
1154
1155         A null WKURLRef is created in the API of WebKit 2 when converting a null string. The code
1156         of WKPageLoadURL assume the WKPageRef is not null which causes crashes if it is.
1157
1158         This patch uses the converter toWTFString() to pass from WKPageRef to WTFString. This converter
1159         ensure the returned string is a valid null string.
1160
1161         Tested through the Qt API tests.
1162
1163         * UIProcess/API/C/WKPage.cpp:
1164         (WKPageLoadURL):
1165         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp:
1166         (tst_QGraphicsWKView::loadEmptyUrl):
1167         * UIProcess/API/qt/tests/qwkpage/qwkpage.pro: Added.
1168         * UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp: Added.
1169         (tst_QWKPage::init):
1170         (tst_QWKPage::cleanup):
1171         (tst_QWKPage::loadEmptyUrl):
1172         * UIProcess/API/qt/tests/tests.pro:
1173
1174 2011-03-15  Brady Eidson  <beidson@apple.com>
1175
1176         Reviewed by Sam Weinig.
1177
1178         https://bugs.webkit.org/show_bug.cgi?id=56425
1179         WebKit2 icon database.
1180
1181         Project file paperwork:
1182         * DerivedSources.make:
1183         * DerivedSources.pro:
1184         * GNUmakefile.am:
1185         * WebKit2.pri:
1186         * WebKit2.pro:
1187         * WebKit2.xcodeproj/project.pbxproj:
1188         * win/WebKit2.vcproj:
1189         * win/WebKit2Common.vsprops:
1190         * Scripts/webkit2/messages.py: Special-case capitalization for messages that start with "URL" to be lowercased
1191           to "url" instead of "uRL".
1192
1193         Add messaging-related stuff:
1194         * Platform/CoreIPC/MessageID.h:
1195         * UIProcess/WebIconDatabase.messages.in: Added.
1196         * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: Added.
1197         * UIProcess/WebProcessProxy.cpp:
1198         (WebKit::WebProcessProxy::didReceiveMessage):
1199         (WebKit::WebProcessProxy::didReceiveSyncMessage):
1200
1201         Prep to make WebIconDatabase an API object:
1202         * Shared/APIObject.h:
1203
1204         Add an "icon DB is enabled" flag to WebProcessCreationParameters:
1205         * Shared/WebProcessCreationParameters.cpp:
1206         (WebKit::WebProcessCreationParameters::encode):
1207         (WebKit::WebProcessCreationParameters::decode):
1208         * Shared/WebProcessCreationParameters.h:
1209
1210         Add SPI for client apps to set the icon database path:
1211         * UIProcess/API/C/WKContext.cpp:
1212         (WKContextSetIconDatabasePath):
1213         * UIProcess/API/C/WKContextPrivate.h:
1214         * UIProcess/WebContext.h:
1215         (WebKit::WebContext::setIconDatabasePath):
1216
1217         Hook up initialization, clearing, and messaging for the icon database:
1218         * UIProcess/WebContext.cpp:
1219         (WebKit::WebContext::WebContext):
1220         (WebKit::WebContext::~WebContext):
1221         (WebKit::WebContext::ensureWebProcess):
1222         (WebKit::WebContext::didReceiveMessage):
1223         (WebKit::WebContext::didReceiveSyncMessage):
1224         (WebKit::WebContext::iconDatabasePath):
1225         * UIProcess/gtk/WebContextGtk.cpp:
1226         (WebKit::WebContext::platformDefaultIconDatabasePath):
1227         * UIProcess/mac/WebContextMac.mm:
1228         (WebKit::WebContext::platformDefaultIconDatabasePath):
1229         * UIProcess/qt/WebContextQt.cpp:
1230         (WebKit::WebContext::platformDefaultIconDatabasePath):
1231         * UIProcess/win/WebContextWin.cpp:
1232         (WebKit::WebContext::platformDefaultIconDatabasePath):
1233
1234         Add the UIProcess-side IconDatabase. It will be the "actual database" as well as the API object:
1235         * UIProcess/WebIconDatabase.cpp: Added.
1236         (WebKit::WebIconDatabase::create):
1237         (WebKit::WebIconDatabase::~WebIconDatabase):
1238         (WebKit::WebIconDatabase::WebIconDatabase):
1239         (WebKit::WebIconDatabase::invalidate):
1240         (WebKit::WebIconDatabase::retainIconForPageURL):
1241         (WebKit::WebIconDatabase::releaseIconForPageURL):
1242         (WebKit::WebIconDatabase::setIconURLForPageURL):
1243         (WebKit::WebIconDatabase::setIconDataForIconURL):
1244         (WebKit::WebIconDatabase::iconDataForPageURL):
1245         (WebKit::WebIconDatabase::iconURLForPageURL):
1246         (WebKit::WebIconDatabase::iconDataKnownForIconURL):
1247         (WebKit::WebIconDatabase::loadDecisionForIconURL):
1248         (WebKit::WebIconDatabase::didReceiveMessage):
1249         (WebKit::WebIconDatabase::didReceiveSyncMessage):
1250         * UIProcess/WebIconDatabase.h: Added.
1251         (WebKit::WebIconDatabase::clearContext):
1252         (WebKit::WebIconDatabase::type):
1253
1254         Add the WebProcess-side IconDatabaseProxy. It acts as the WebCore IconDatabase and operates via messaging:
1255         * WebProcess/IconDatabase: Added.
1256         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: Added.
1257         (WebKit::WebIconDatabaseProxy::~WebIconDatabaseProxy):
1258         (WebKit::WebIconDatabaseProxy::WebIconDatabaseProxy):
1259         (WebKit::WebIconDatabaseProxy::isEnabled):
1260         (WebKit::WebIconDatabaseProxy::setEnabled):
1261         (WebKit::WebIconDatabaseProxy::iconForPageURL):
1262         (WebKit::WebIconDatabaseProxy::retainIconForPageURL):
1263         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL):
1264         (WebKit::WebIconDatabaseProxy::iconURLForPageURL):
1265         (WebKit::WebIconDatabaseProxy::iconDataKnownForIconURL):
1266         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL):
1267         (WebKit::WebIconDatabaseProxy::setIconURLForPageURL):
1268         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL):
1269         (WebKit::WebIconDatabaseProxy::urlImportFinished):
1270         (WebKit::WebIconDatabaseProxy::didReceiveMessage):
1271         * WebProcess/IconDatabase/WebIconDatabaseProxy.h: Added.
1272
1273         Hook up initialization and messaging for the icon database proxy:
1274         * WebProcess/WebProcess.cpp:
1275         (WebKit::WebProcess::WebProcess):
1276         (WebKit::WebProcess::initializeWebProcess):
1277         (WebKit::WebProcess::didReceiveMessage):
1278         * WebProcess/WebProcess.h:
1279
1280 2011-03-15  Sam Weinig  <sam@webkit.org>
1281
1282         Reviewed by Anders Carlsson.
1283
1284         WebKit2: False SPOD cursor when context menu is open
1285         <rdar://problem/9029154>
1286         https://bugs.webkit.org/show_bug.cgi?id=56433
1287
1288         * UIProcess/WebPageProxy.cpp:
1289         (WebKit::WebPageProxy::showContextMenu):
1290         Update to match showPopupMenu idiomatically, and stop the responsivenessTimer
1291         since the act of showing the context menu could spin a nested runloop.
1292
1293         * UIProcess/mac/WebContextMenuProxyMac.mm:
1294         (WebKit::WebContextMenuProxyMac::showContextMenu):
1295         * UIProcess/qt/WebContextMenuProxyQt.cpp:
1296         (WebKit::WebContextMenuProxyQt::showContextMenu):
1297         * UIProcess/win/WebContextMenuProxyWin.cpp:
1298         (WebKit::WebContextMenuProxyWin::showContextMenu):
1299         Move isEmpty() check to implementations, since we don't want to show
1300         this in any case, not just the one where we check it.
1301
1302 2011-03-15  Siddharth Mathur  <siddharth.mathur@nokia.com>
1303
1304         Reviewed by Laszlo Gombos.
1305
1306         [Qt][Symbian][WK2] Fix exporting and importing the WebProcessMainQt symbol
1307         https://bugs.webkit.org/show_bug.cgi?id=56417
1308
1309         Use the Q_DECL_EXPORT and Q_DECL_IMPORT macros directly to make sure
1310         the symbol is always exported/imported.
1311
1312         * WebProcess/qt/WebProcessMainQt.cpp:
1313         (WebKit::WebProcessMainQt):
1314         * qt/MainQt.cpp:
1315
1316 2011-03-15  Alexey Proskuryakov  <ap@apple.com>
1317
1318         Reviewed by Darin Adler.
1319
1320         REGRESSION (WebKit2): keygen element doesn't work
1321         https://bugs.webkit.org/show_bug.cgi?id=56402
1322         <rdar://problem/9006545>
1323
1324         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1325         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1326         Added strings used by keygen.
1327
1328         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: Initialize a WebCore pointer to
1329         a function used by keygen.
1330
1331 2011-03-15  Beth Dakin  <bdakin@apple.com>
1332
1333         Reviewed by Simon Fraser.
1334
1335         WebKit2 part of <rdar://problem/9075624> Overlay scrollbars slow down PLT by 6%
1336
1337         New WebKitystemInterface function to force the scrollbars to flash
1338         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1339         (InitWebCoreSystemInterface):
1340
1341 2011-03-15  Anders Carlsson  <andersca@apple.com>
1342
1343         Reviewed by Sam Weinig.
1344
1345         Make sure that NP_Shutdown is always the last NPP function called
1346         https://bugs.webkit.org/show_bug.cgi?id=56391
1347         <rdar://problem/8989902>
1348
1349         Make sure to always increment the load count whenever a web process connection
1350         is opened to a plug-in process, and decrement it when the last web process connection
1351         goes away.
1352
1353         * PluginProcess/PluginProcess.cpp:
1354         (WebKit::PluginProcess::createWebProcessConnection):
1355         (WebKit::PluginProcess::startShutdownTimerIfNecessary):
1356         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1357         * Shared/Plugins/Netscape/NetscapePluginModule.h:
1358         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1359         (WebKit::NetscapePlugin::NetscapePlugin):
1360         (WebKit::NetscapePlugin::~NetscapePlugin):
1361
1362 2011-03-15  Martin Robinson  <mrobinson@igalia.com>
1363
1364         Reviewed by Adam Barth.
1365
1366         [GTK] [WebKit2] The UIProcess never changes the mouse cursor
1367         https://bugs.webkit.org/show_bug.cgi?id=56333
1368
1369         Add an implementation for WebView::addCursor for WebKit2 GTK+. This allows
1370         the cursor to change as the user mouses around the page. There is currently
1371         no test infrastructure to track cursor changes.
1372
1373         * UIProcess/gtk/WebView.cpp:
1374         (WebKit::WebView::setCursor): Ported implementation from WebKit1.
1375
1376 2011-03-15  Kevin Ollivier  <kevino@theolliviers.com>
1377
1378         Reviewed by Darin Adler.
1379
1380         Introduce WTF_USE_EXPORT_MACROS, which will allow us to put shared library import/export
1381         info into the headers rather than in export symbol definition files, but disable it on 
1382         all platforms initially so we can deal with port build issues one port at a time.
1383         
1384         https://bugs.webkit.org/show_bug.cgi?id=27551
1385
1386         * config.h:
1387
1388 2011-03-14  Alexey Proskuryakov  <ap@apple.com>
1389
1390         Reviewed by Darin Adler.
1391
1392         REGRESSION: Print preview is blank when selecting multiple pages per sheet
1393         https://bugs.webkit.org/show_bug.cgi?id=56341
1394         <rdar://problem/8991382>
1395
1396         * UIProcess/API/mac/WKPrintingView.mm: (pageDidDrawToPDF): Don't reset latest expected
1397         callback number after receiving a different one. We only update preview after receiving
1398         the latest expected page data (and the assumption is that AppKit will ask for pages in
1399         natural order for N-up).
1400
1401 2011-03-14  Adam Roben  <aroben@apple.com>
1402
1403         Make WKBundlePageCanHandleRequest return true for empty document URLs
1404
1405         Reviewed by Sam Weinig.
1406
1407         * WebProcess/WebPage/WebPage.cpp:
1408         (WebKit::WebPage::canHandleRequest): Return true for any URL schemes that are handled as
1409         empty documents, and defer to the platform for everything else.
1410
1411         * WebProcess/WebPage/WebPage.h: Added platformCanHandleRequest.
1412
1413         * WebProcess/WebPage/mac/WebPageMac.mm:
1414         (WebKit::WebPage::platformCanHandleRequest):
1415         * WebProcess/WebPage/qt/WebPageQt.cpp:
1416         (WebKit::WebPage::platformCanHandleRequest):
1417         * WebProcess/WebPage/win/WebPageWin.cpp:
1418         (WebKit::WebPage::platformCanHandleRequest):
1419         Renamed from canHandleRequest.
1420
1421 2011-03-14  Chris Fleizach  <cfleizach@apple.com>
1422
1423         Reviewed by Beth Dakin.
1424
1425         CrashTracer: 60 crashes in WebProcess at com.apple.WebKit2: -[AccessibilityWebPageObject accessibilityHitTest:] + 248
1426         https://bugs.webkit.org/show_bug.cgi?id=56336
1427
1428         Crash trace indicates a nil pointer access in one of these m_page->mainFrame()->coreFrame()->view()
1429         pointers.
1430
1431         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm:
1432         (-[AccessibilityWebPageObject accessibilityHitTest:]):
1433
1434 2011-03-14  Alice Liu  <alice.liu@apple.com>
1435
1436         Reviewed by Sam Weinig.
1437
1438         Provide API for creating WKImage from CGImageRef
1439         https://bugs.webkit.org/show_bug.cgi?id=56159
1440
1441         Add function for creating a WKImage from CGImage data.
1442         * Shared/API/c/cg/WKImageCG.cpp:
1443         (WKImageCreateFromCGImage): Added. Creates a graphics context for the bitmap-backed image and draws into it. 
1444         * Shared/API/c/cg/WKImageCG.h:
1445
1446 2011-03-14  Balazs Kelemen  <kbalazs@webkit.org>
1447
1448         Reviewed by Adam Roben.
1449
1450         [Qt][WK2]Unbreak InjectedBundle on Qt
1451         https://bugs.webkit.org/show_bug.cgi?id=54109
1452
1453         Add API's to WKURL and WKString to satisfy
1454         WebKitTestRunner's needs.
1455
1456         * Shared/API/c/WKString.cpp:
1457         (WKStringIsEqualToUTF8CStringIgnoringCase):
1458         * Shared/API/c/WKString.h:
1459         * Shared/API/c/WKURL.cpp:
1460         (WKURLCopyHostName):
1461         (WKURLCopyScheme):
1462         * Shared/API/c/WKURL.h:
1463         * Shared/WebString.h:
1464         (WebKit::WebString::equalToUTF8StringIgnoringCase):
1465         * Shared/WebURL.h: Added OwnPtr<KURL> member to be able
1466         to lazily parse the URL and store the result.
1467         (WebKit::WebURL::host):
1468         (WebKit::WebURL::protocol):
1469         (WebKit::WebURL::parseURLIfNecessary):
1470         * win/WebKit2.def: Revert the symbol exports that were
1471         needed to use KURL in WebKitTestRunner.
1472
1473 2011-03-14  Jeff Miller  <jeffm@apple.com>
1474
1475         Reviewed by Adam Roben.
1476
1477         Add WKViewSetScrollOffsetOnNextResize() to C API on Windows
1478         https://bugs.webkit.org/show_bug.cgi?id=56340
1479
1480         * UIProcess/API/C/win/WKView.cpp:
1481         (WKViewSetScrollOffsetOnNextResize): Added.
1482         * UIProcess/API/C/win/WKView.h: Added WKViewSetScrollOffsetOnNextResize().
1483         * UIProcess/win/WebView.cpp:
1484         (WebKit::WebView::onSizeEvent): Apply any scroll offset when setting the drawing area size.
1485         (WebKit::WebView::setScrollOffsetOnNextResize): Added.
1486         * UIProcess/win/WebView.h: Added setScrollOffsetOnNextResize().
1487
1488 2011-03-14  Brian Weinstein  <bweinstein@apple.com>
1489
1490         Reviewed by Adam Roben and Gavin Barraclough.
1491
1492         FileSystemWin.cpp needs listDirectory() implementation
1493         https://bugs.webkit.org/show_bug.cgi?id=56331
1494         <rdar://problem/9126635>
1495         
1496         Move PathWalker down into WebCore, and call the PathWalker in WebCore
1497         (that now has a second argument, the pattern to take).
1498
1499         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
1500         (WebKit::PluginInfoStore::pluginPathsInDirectory):
1501
1502 2011-03-14  Sam Weinig  <sam@webkit.org>
1503
1504         Reviewed by Darin Adler.
1505
1506         WebKit2: No icon shown for <input type=file>
1507         <rdar://problem/8988982>
1508         https://bugs.webkit.org/show_bug.cgi?id=54288
1509
1510         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1511         (WebKit::WebChromeClient::chooseIconForFiles):
1512         Add implementation for chooseIconForFiles which calls down to Icon::createIconForFiles.
1513
1514 2011-03-14  Brady Eidson  <beidson@apple.com>
1515
1516         Reviewed by Dan Bernstein.
1517
1518         <rdar://problem/8762095> and https://bugs.webkit.org/show_bug.cgi?id=55172
1519         Need WK2 API to view/manage origins with LocalStorage
1520
1521         Hookup the existing API stubs to the WebCore implementations:
1522         * WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp:
1523         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
1524         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
1525         (WebKit::WebKeyValueStorageManager::deleteAllEntries):
1526
1527 2011-03-13  Brady Eidson  <beidson@apple.com>
1528
1529         Reviewed by Sam Weinig.
1530
1531         <rdar://problem/9127270> and https://bugs.webkit.org/show_bug.cgi?id=56282
1532
1533         Pass the path along with creation parameters:
1534         * Shared/WebProcessCreationParameters.cpp:
1535         (WebKit::WebProcessCreationParameters::encode):
1536         (WebKit::WebProcessCreationParameters::decode):
1537         * Shared/WebProcessCreationParameters.h:
1538
1539         Add SPI to set the path:
1540         * UIProcess/API/C/WKContext.cpp:
1541         (WKContextSetLocalStorageDirectory):
1542         * UIProcess/API/C/WKContextPrivate.h:
1543
1544         Pass the path along in the process creation parameters:
1545         * UIProcess/WebContext.cpp:
1546         (WebKit::WebContext::ensureWebProcess):
1547         (WebKit::WebContext::localStorageDirectory):
1548         * UIProcess/WebContext.h:
1549         (WebKit::WebContext::setLocalStorageDirectory):
1550
1551         * UIProcess/gtk/WebContextGtk.cpp:
1552         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
1553         * UIProcess/mac/WebContextMac.mm:
1554         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
1555         * UIProcess/qt/WebContextQt.cpp:
1556         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
1557         * UIProcess/win/WebContextWin.cpp:
1558         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
1559
1560         Include the path with settings updates, because WebCore needs it set on the Settings object:
1561         * WebProcess/WebPage/WebPage.cpp:
1562         (WebKit::WebPage::updatePreferences):
1563
1564         * WebProcess/WebProcess.cpp:
1565         (WebKit::WebProcess::initializeWebProcess):
1566         * WebProcess/WebProcess.h:
1567         (WebKit::WebProcess::localStorageDirectory):
1568
1569         Sandboxing stuff:
1570         * WebProcess/com.apple.WebProcess.sb:
1571         * WebProcess/mac/WebProcessMac.mm:
1572         (WebKit::initializeSandbox):
1573
1574 2011-03-12  Jer Noble  <jer.noble@apple.com>
1575
1576         Reviewed by Mark Rowe.
1577
1578         WebKit2: Build WKFullScreenWindowController cleanly in 32-bit.
1579         https://bugs.webkit.org/show_bug.cgi?id=56260
1580
1581         Include <Carbon/Carbon.h> instead of <HIToolbox/MacApplication.h>.
1582
1583         * UIProcess/mac/WKFullScreenWindowController.mm:
1584
1585 2011-03-13  Sam Weinig  <sam@webkit.org>
1586
1587         Reviewed by Anders Carlsson.
1588
1589         Add ability to create a WKErrorRef
1590         <rdar://problem/9115768>
1591         https://bugs.webkit.org/show_bug.cgi?id=56279
1592
1593         * Shared/API/c/cf/WKErrorCF.cpp: Added.
1594         (WKErrorCreateWithCFError):
1595         (WKErrorCopyCFError):
1596         * Shared/API/c/cf/WKErrorCF.h: Added.
1597         Add new API to create a WKErrorRef from a CFErrorRef
1598         and vice-versa.
1599
1600         * WebKit2.xcodeproj/project.pbxproj:
1601         * win/WebKit2.vcproj:
1602         * win/WebKit2Generated.make:
1603         Add new files.
1604
1605 2011-03-13  Pratik Solanki  <psolanki@apple.com>
1606
1607         Reviewed by Brady Eidson.
1608
1609         Make adjustMIMETypeIfNecessary use CFNetwork directly
1610         https://bugs.webkit.org/show_bug.cgi?id=55912
1611
1612         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1613         (InitWebCoreSystemInterface): Support for new WKSI functions.
1614
1615 2011-03-13  Dan Bernstein  <mitz@apple.com>
1616
1617         Reviewed by Darin Adler.
1618
1619         WebPageProxy cleanup
1620         https://bugs.webkit.org/show_bug.cgi?id=56267
1621
1622         * UIProcess/WebPageProxy.cpp: Moved all Mac-only function implementations from
1623         here to WebPageProxyMac.mm.
1624         * UIProcess/WebPageProxy.h: Cleaned up #includes.
1625         * UIProcess/mac/WebPageProxyMac.mm: Moved all Mac-only function implementations
1626         here.
1627         (WebKit::WebPageProxy::updateWindowIsVisible):
1628         (WebKit::WebPageProxy::windowAndViewFramesChanged):
1629         (WebKit::WebPageProxy::getMarkedRange):
1630         (WebKit::WebPageProxy::characterIndexForPoint):
1631         (WebKit::WebPageProxy::firstRectForCharacterRange):
1632         (WebKit::WebPageProxy::writeSelectionToPasteboard):
1633         (WebKit::WebPageProxy::setDragImage):
1634         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
1635         (WebKit::WebPageProxy::interpretKeyEvent):
1636         (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
1637         (WebKit::WebPageProxy::uppercaseWord):
1638         (WebKit::WebPageProxy::lowercaseWord):
1639         (WebKit::WebPageProxy::capitalizeWord):
1640         (WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
1641         (WebKit::WebPageProxy::didPerformDictionaryLookup):
1642         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
1643         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
1644         (WebKit::WebPageProxy::setComplexTextInputEnabled):
1645
1646 2011-03-13  Dan Bernstein  <mitz@apple.com>
1647
1648         Reviewed by Darin Adler.
1649
1650         <rdar://problem/8949683> WebKit2: Drag image is offset when the page is scrolled down
1651         https://bugs.webkit.org/show_bug.cgi?id=56265
1652
1653         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1654         (WebKit::WebDragClient::startDrag): Send the location in view coordinates rather than
1655         document coordinates.
1656
1657 2011-03-13  Dan Bernstein  <mitz@apple.com>
1658
1659         Reviewed by Mark Rowe.
1660
1661         Fix a crash when dragging.
1662
1663         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1664         (WebKit::convertImageToBitmap): Retain the saved context.
1665
1666 2011-03-12  Darin Adler  <darin@apple.com>
1667
1668         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1669         (WebKit::WebDragClient::startDrag): Fixed typo in a comment.
1670
1671 2011-03-11  Darin Adler  <darin@apple.com>
1672
1673         Reviewed by Sam Weinig.
1674
1675         Dragging image to desktop gives webloc instead of image file in WebKit2
1676         https://bugs.webkit.org/show_bug.cgi?id=56193
1677
1678         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1679         (WebKit::convertImageToBitmap): Added. Factored out from startDrag to
1680         make the startDrag code clearer.
1681         (WebKit::WebDragClient::startDrag): Streamlined code a bit.
1682         (WebKit::cachedImage): Added. Helper for function below.
1683         (WebKit::arrayForURLsWithTitles): Added. Helper for function below.
1684         (WebKit::WebDragClient::declareAndWriteDragImage): Added code to handle file
1685         promises and removed a log of uneeded code.
1686         (-[WKPasteboardFilePromiseOwner copyDropDirectory]): Added.
1687         (promisedDataClient): Added.
1688         (-[WKPasteboardOwner clearImage]): Added.
1689         (-[WKPasteboardOwner initWithImage:]): Added.
1690         (-[WKPasteboardOwner dealloc]): Added.
1691         (-[WKPasteboardOwner finalize]): Added.
1692         (-[WKPasteboardOwner pasteboard:provideDataForType:]): Added.
1693         (-[WKPasteboardOwner pasteboardChangedOwner:]): Added.
1694         (matchesExtensionOrEquivalent): Added.
1695         (-[WKPasteboardOwner namesOfPromisedFilesDroppedAtDestination:]): Added.
1696         Much of the new code above came from the WebKit1 drag code.
1697
1698         * WebProcess/WebPage/WebPage.cpp:
1699         (WebKit::WebPage::dragEnded): Added call to Mac-only platformDragEnded.
1700         * WebProcess/WebPage/WebPage.h: Added Mac-only platformDragEnded and m_dragSource.
1701         * WebProcess/WebPage/mac/WebPageMac.mm:
1702         (WebKit::WebPage::setDragSource): Added.
1703         (WebKit::WebPage::platformDragEnded): Added.
1704
1705 2011-03-12  Mark Rowe  <mrowe@apple.com>
1706
1707         Fix the 32-bit build.
1708
1709         This involves hacking around some HIToolbox headers that do things of dubious correctness,
1710         and fixing the usual CGRect vs NSRect issues.
1711         
1712         * UIProcess/mac/WKFullScreenWindowController.mm:
1713         (-[WKFullScreenWindowController enterFullScreen:]): NSRect is not CGRect.
1714         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
1715         (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto.
1716
1717 2011-03-12  Anders Carlsson  <andersca@apple.com>
1718
1719         Reviewed by Sam Weinig.
1720
1721         * WebProcess/WebPage/WebFrame.cpp:
1722         (WebKit::WebFrame::url):
1723         Get the URL from the loader, not from the document.
1724
1725         (WebKit::WebFrame::suggestedFilenameForResourceWithURL):
1726         Return the correct suggested filename for the main resource.
1727
1728         (WebKit::WebFrame::mimeTypeForResourceWithURL):
1729         Return the correct mime type for the main resource.
1730
1731 2011-03-12  Anders Carlsson  <andersca@apple.com>
1732
1733         Reviewed by Sam Weinig.
1734
1735         Should be able to download a PDF to the Downloads folder
1736         https://bugs.webkit.org/show_bug.cgi?id=56256
1737
1738         * UIProcess/API/C/WKPage.h:
1739         Add WKPageSaveDataToFileInDownloadsFolderCallback to the UI client.
1740
1741         * UIProcess/API/mac/PDFViewController.h:
1742         * UIProcess/API/mac/PDFViewController.mm:
1743         (-[WKPDFView _applyPDFPreferences]):
1744         (-[WKPDFView _updatePreferences:]):
1745         Use new PDFViewController::page getter.
1746
1747         (-[WKPDFView PDFViewSavePDFToDownloadFolder:]):
1748         Call PDFViewController::savePDFToDownloadsFolder.
1749
1750         (WebKit::releaseCFData):
1751         (WebKit::PDFViewController::savePDFToDownloadsFolder):
1752         Create a WebData that wraps the CFData, then pass it along to
1753         WebPageProxy::saveDataToFileInDownloadsFolder.
1754
1755         * UIProcess/WebPageProxy.cpp:
1756         (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder):
1757         Call WebUIClient::saveDataToFileInDownloadsFolder.
1758
1759         (WebKit::WebUIClient::saveDataToFileInDownloadsFolder):
1760         * UIProcess/WebUIClient.h:
1761         Call the UI client callback function.
1762
1763 2011-03-12  Anders Carlsson  <andersca@apple.com>
1764
1765         Reviewed by Sam Weinig.
1766
1767         WebData should be able to wrap already existing data
1768         https://bugs.webkit.org/show_bug.cgi?id=56254
1769
1770         * Shared/WebData.h:
1771         (WebKit::WebData::createWithoutCopying):
1772         (WebKit::WebData::create):
1773         (WebKit::WebData::~WebData):
1774         (WebKit::WebData::bytes):
1775         (WebKit::WebData::size):
1776         (WebKit::WebData::WebData):
1777         (WebKit::WebData::fastFreeBytes):
1778
1779 2011-03-12  Jer Noble  <jer.noble@apple.com>
1780
1781         Reviewed by Eric Carlson.
1782
1783         WebKit2: Initialize the WebFullScreenManagerProxy with a WKView
1784         https://bugs.webkit.org/show_bug.cgi?id=56250
1785
1786         * UIProcess/API/mac/WKView.mm:
1787         (-[WKView initWithFrame:contextRef:pageGroupRef:]): Call fullScreenManager()->setView(self).
1788
1789 2011-03-11  Jer Noble  <jer.noble@apple.com>
1790
1791         Reviewed by Anders Carlsson.
1792
1793         Add full screen animation code to WebFullScreenManager.
1794         https://bugs.webkit.org/show_bug.cgi?id=56220
1795
1796         * WebProcess/FullScreen/WebFullScreenManager.cpp: .
1797         (WebKit::WebFullScreenManager::~WebFullScreenManager): Added.
1798         (WebKit::WebFullScreenManager::exitFullScreenForElement): Remove ASSERTs.
1799         (WebKit::WebFullScreenManager::willEnterFullScreen): Set the full screen renderer's background color.
1800         (WebKit::WebFullScreenManager::didEnterFullScreen): Ditto.
1801         (WebKit::WebFullScreenManager::willExitFullScreen): Ditto.
1802         (WebKit::WebFullScreenManager::didExitFullScreen): Ditto.
1803         * WebProcess/FullScreen/WebFullScreenManager.h: Make a few functions pure virtual to be implemented in a 
1804             concrete subclass.
1805         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: Added.
1806         * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: Added.
1807         (-[WebFullScreenManagerAnimationListener initWithManager:WebKit::began:finished:]): Listener for CAAnimations.
1808         (-[WebFullScreenManagerAnimationListener animationDidStart:]): Added.
1809         (-[WebFullScreenManagerAnimationListener animationDidStop:finished:]): Added.
1810         (-[WebFullScreenManagerAnimationListener invalidate]): Added.
1811         (WebKit::WebFullScreenManager::create): Now creates a WebFullScreenManagerMac.
1812         (WebKit::WebFullScreenManagerMac::create): Added.
1813         (WebKit::WebFullScreenManagerMac::WebFullScreenManagerMac): Added.
1814         (WebKit::WebFullScreenManagerMac::~WebFullScreenManagerMac): Added.
1815         (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): Set up the remote layer host.
1816         (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): Create a CATransform3D
1817             which will animate the full screen renderer from its initial position to its final one.
1818         (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto.
1819
1820 2011-03-11  Jer Noble  <jer.noble@apple.com>
1821
1822         Reviewed by Anders Carlsson.
1823
1824         Hook up new WKFullScreenWindowController functions to WebFullScreenManagerProxy
1825         https://bugs.webkit.org/show_bug.cgi?id=56218
1826
1827         * UIProcess/WebFullScreenManagerProxy.cpp:
1828         * UIProcess/mac/WebFullScreenManagerProxyMac.mm: Added.
1829         (WebKit::WebFullScreenManagerProxy::enterFullScreen): Call into WKFullScreenWindowController.
1830         (WebKit::WebFullScreenManagerProxy::exitFullScreen): Ditto.
1831         (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): Ditto.
1832         (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): Ditto.
1833         (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): Ditto.
1834         (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): Ditto.
1835         (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): Ditto.
1836         (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): Ditto.
1837         (WebKit::WebFullScreenManagerProxy::getFullScreenRect): Ditto.
1838         * UIProcess/API/mac/WKView.mm:
1839         (-[WKView fullScreenWindowController]): Lazily instantiate a WKFullScreenWindowController.
1840         * UIProcess/API/mac/WKViewInternal.h:
1841
1842 2011-03-11  Jer Noble  <jer.noble@apple.com>
1843
1844         Reviewed by Anders Carlsson.
1845
1846         Add the WKFullScreenWindowController, mostly cribbed from WebKit's WebFullScreenController.
1847
1848         [WebKit2] Implement a full screen window controller
1849         https://bugs.webkit.org/show_bug.cgi?id=56210
1850
1851         * UIProcess/mac/WKFullScreenWindowController.h: Added.
1852         * UIProcess/mac/WKFullScreenWindowController.mm: Added.
1853         (-[WKFullScreenWindowController init]): Remove the _mediaEventListener.
1854         (-[WKFullScreenWindowController dealloc]): Make sure to cancel previous async requests.
1855         (-[WKFullScreenWindowController windowDidLoad]): Remove the Tiger protection.
1856         (-[WKFullScreenWindowController webView]): Type change.
1857         (-[WKFullScreenWindowController setWebView:]): Type change.
1858         (-[WKFullScreenWindowController applicationDidResignActive:]): Case changes.
1859         (-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): Case changes.
1860         (-[WKFullScreenWindowController enterFullScreen:]): Removed most of the animation code
1861             which will reappear in WebFullScreenManager.
1862         (-[WKFullScreenWindowController beganEnterFullScreenAnimation]): Added.
1863         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Added.
1864         (-[WKFullScreenWindowController exitFullScreen]): Ditto to enterFullScreen.
1865         (-[WKFullScreenWindowController beganExitFullScreenAnimation]): Added.
1866         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Added.
1867         (-[WKFullScreenWindowController enterAcceleratedCompositingMode:WebKit::]): Set up the
1868             layer tree host.
1869         (-[WKFullScreenWindowController exitAcceleratedCompositingMode]): Tear down same.
1870         (-[WKFullScreenWindowController getFullScreenRect:WebCore::]): Added.
1871         (-[WKFullScreenWindowController _updateMenuAndDockForFullScreen]): Case changes.
1872         (-[WKFullScreenWindowController _disableIdleDisplaySleep]): Ditto.
1873         (-[WKFullScreenWindowController _enableIdleDisplaySleep]): Ditto.
1874         (-[WKFullScreenWindowController _disableIdleSystemSleep]): Ditto.
1875         (-[WKFullScreenWindowController _enableIdleSystemSleep]): Ditto.
1876         (-[WKFullScreenWindowController _enableTickleTimer]): Ditto.
1877         (-[WKFullScreenWindowController _disableTickleTimer]): Ditto.
1878         (-[WKFullScreenWindowController _tickleTimerFired]): Ditto.
1879         (-[WKFullScreenWindowController _updatePowerAssertions]): Use _isPlaying ivar.
1880         (-[WKFullScreenWindowController _manager]): Added.
1881         (-[WKFullScreenWindowController _requestExit]): Case changes.
1882         (-[WKFullScreenWindowController _requestExitFullScreenWithAnimation:]): Ditto.
1883         (-[WKFullScreenWindowController _swapView:with:]): Added.
1884         (-[WKFullScreenWindowController _fullScreenWindow]): Case changes.
1885         (-[WKFullScreenWindow initWithContentRect:styleMask:backing:defer:]): Geometry no
1886             longer needs to be flipped.
1887         (-[WKFullScreenWindow cancelOperation:]): Case changes.
1888
1889 2011-03-11  Jer Noble  <jer.noble@apple.com>
1890
1891         Reviewed by Anders Carlsson.
1892
1893         Create new interface stubs to support full screen mode in WebKit2.
1894
1895         WebKit2: Plumb new full screen animation APIs through WebKit2.
1896         https://bugs.webkit.org/show_bug.cgi?id=55993
1897
1898         * UIProcess/WebFullScreenManagerProxy.cpp:
1899         (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy): Added.
1900         (WebKit::WebFullScreenManagerProxy::invalidate): Clear m_webView.
1901         (WebKit::WebFullScreenManagerProxy::setWebView): Set m_webView.
1902         (WebKit::WebFullScreenManagerProxy::beginEnterFullScreenAnimation): Added.
1903         (WebKit::WebFullScreenManagerProxy::beginExitFullScreenAnimation): Added.
1904         (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): Added stub.
1905         (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): Added stub.
1906         (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): Added stub.
1907         (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): Added stub.
1908         (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): Added stub.
1909         (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): Added stub.
1910         (WebKit::WebFullScreenManagerProxy::getFullScreenRect): Added stub.
1911         * UIProcess/WebFullScreenManagerProxy.h:
1912         * UIProcess/WebFullScreenManagerProxy.messages.in: Added new message definitions.
1913         * UIProcess/WebPageProxy.cpp: Moved include of WebFullScreenManagerProxy.h into source file.
1914         * UIProcess/WebPageProxy.h: Ditto.
1915         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1916         (WebKit::WebFullScreenManager::element): Added.
1917         (WebKit::WebFullScreenManager::supportsFullScreen): Send message through WebPage.
1918         (WebKit::WebFullScreenManager::enterFullScreenForElement): Ditto.
1919         (WebKit::WebFullScreenManager::exitFullScreenForElement): Ditto.
1920         (WebKit::WebFullScreenManager::beganEnterFullScreenAnimation): Added..
1921         (WebKit::WebFullScreenManager::finishedEnterFullScreenAnimation): Added.
1922         (WebKit::WebFullScreenManager::beganExitFullScreenAnimation): Added.
1923         (WebKit::WebFullScreenManager::finishedExitFullScreenAnimation): Added.
1924         (WebKit::WebFullScreenManager::setRootFullScreenLayer): Added stub.
1925         (WebKit::WebFullScreenManager::getFullScreenRect): Added.
1926         (WebKit::WebFullScreenManager::beginEnterFullScreenAnimation): Added stub.
1927         (WebKit::WebFullScreenManager::beginExitFullScreenAnimation): Added stub.
1928         * WebProcess/FullScreen/WebFullScreenManager.h:
1929         * WebProcess/FullScreen/WebFullScreenManager.messages.in: Added new message definitions.
1930         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1931         (WebKit::WebChromeClient::setRootFullScreenLayer): Added.
1932         * WebProcess/WebCoreSupport/WebChromeClient.h:
1933
1934 2011-03-11  Alice Liu  <alice.liu@apple.com>
1935
1936         Reviewed by Sam Weinig.
1937
1938         Support encoding /decoding WebData in usermessages
1939         https://bugs.webkit.org/show_bug.cgi?id=56158
1940
1941         Added encoding/decoding for APIObject::TypeData
1942         * Shared/UserMessageCoders.h:
1943         (WebKit::UserMessageEncoder::baseEncode):
1944         (WebKit::UserMessageDecoder::baseDecode):
1945
1946 2011-03-11  Alice Liu  <alice.liu@apple.com>
1947
1948         Reviewed by Sam Weinig.
1949
1950         Add api for "remove" to WKMutableDictionary
1951         https://bugs.webkit.org/show_bug.cgi?id=56157
1952
1953         * Shared/API/c/WKMutableDictionary.cpp:
1954         (WKDictionaryRemoveItem): Added; call remove on MutableDictionary impl.
1955         * Shared/API/c/WKMutableDictionary.h:
1956         * Shared/MutableDictionary.cpp:
1957         (WebKit::MutableDictionary::remove): Added; call remove on the underlying hashmap.
1958         * Shared/MutableDictionary.h:
1959
1960 2011-03-11  Sheriff Bot  <webkit.review.bot@gmail.com>
1961
1962         Unreviewed, rolling out r80899 and r80912.
1963         http://trac.webkit.org/changeset/80899
1964         http://trac.webkit.org/changeset/80912
1965         https://bugs.webkit.org/show_bug.cgi?id=56236
1966
1967         Caused animation tests to crash on Snow Leopard WebKit2
1968         (Requested by rniwa on #webkit).
1969
1970         * Shared/ShareableBitmap.cpp:
1971         (WebKit::ShareableBitmap::create):
1972         (WebKit::ShareableBitmap::createShareable):
1973         (WebKit::ShareableBitmap::resize):
1974         * Shared/ShareableBitmap.h:
1975         (WebKit::ShareableBitmap::numBytesForSize):
1976         (WebKit::ShareableBitmap::sizeInBytes):
1977         * UIProcess/DrawingAreaProxyImpl.cpp:
1978         (WebKit::DrawingAreaProxyImpl::update):
1979         * WebKit2.xcodeproj/project.pbxproj:
1980         * WebProcess/WebPage/DrawingArea.h:
1981         (WebKit::DrawingArea::didUpdate):
1982         * WebProcess/WebPage/DrawingArea.messages.in:
1983         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1984         (WebKit::DrawingAreaImpl::~DrawingAreaImpl):
1985         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
1986         (WebKit::DrawingAreaImpl::didUpdate):
1987         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
1988         (WebKit::DrawingAreaImpl::display):
1989         * WebProcess/WebPage/DrawingAreaImpl.h:
1990         * WebProcess/WebPage/SharedMemoryCache.cpp: Removed.
1991         * WebProcess/WebPage/SharedMemoryCache.h: Removed.
1992         * win/WebKit2.vcproj:
1993
1994 2011-03-11  Brian Weinstein  <bweinstein@apple.com>
1995
1996         Windows build fix. Add SharedMemoryCache to the vcproj.
1997
1998         * win/WebKit2.vcproj:
1999
2000 2011-03-11  Alexey Proskuryakov  <ap@apple.com>
2001
2002         Reviewed by Sam Weinig.
2003
2004         https://bugs.webkit.org/show_bug.cgi?id=56222
2005         A window remains frozen if web process crashes during printing
2006
2007         * UIProcess/API/mac/PageClientImpl.h:
2008         * UIProcess/API/mac/PageClientImpl.mm:
2009         * UIProcess/PageClient.h:
2010         * UIProcess/WebPageProxy.cpp:
2011         (WebKit::WebPageProxy::setComplexTextInputEnabled):
2012         * UIProcess/WebPageProxy.h:
2013         Moved setAutodisplay code into WKPrintingView.
2014
2015         * UIProcess/API/mac/WKPrintingView.h:
2016         * UIProcess/API/mac/WKView.mm:
2017         (-[WKView printOperationWithPrintInfo:forFrame:]):
2018         Keep a reference to the actual WKView, so that we can manipulate how it displays, even if
2019         page goes away.
2020
2021         * UIProcess/API/mac/WKPrintingView.mm:
2022         (-[WKPrintingView initWithFrameProxy:WebKit::view:]):
2023         (-[WKPrintingView _setAutodisplay:]):
2024         (-[WKPrintingView _suspendAutodisplay]):
2025         (-[WKPrintingView _delayedResumeAutodisplayTimerFired]):
2026         Move setAutodisplay here.
2027
2028 2011-03-11  Anders Carlsson  <andersca@apple.com>
2029
2030         Reviewed by Sam Weinig.
2031
2032         Add a shared memory cache to the web process
2033         https://bugs.webkit.org/show_bug.cgi?id=56232
2034
2035         Add a very simple shared memory cache to the web process, so that we don't have to allocate and
2036         free memory over and over when painting.
2037
2038         * Shared/ShareableBitmap.cpp:
2039         (WebKit::ShareableBitmap::create):
2040         (WebKit::ShareableBitmap::createShareable):
2041         (WebKit::ShareableBitmap::resize):
2042         * Shared/ShareableBitmap.h:
2043         (WebKit::ShareableBitmap::numBytesNeededForBitmapSize):
2044         (WebKit::ShareableBitmap::sizeInBytes):
2045         Rename numBytesForSize to numBytesNeededForBitmapSize.
2046
2047         * UIProcess/DrawingAreaProxyImpl.cpp:
2048         (WebKit::DrawingAreaProxyImpl::update):
2049         Always send back a DidUpdate message, even if we didn't use the update info.
2050         This is needed so that the web process knows when the UI process is done with the shared memory inside
2051         the update info struct.
2052
2053         * WebKit2.xcodeproj/project.pbxproj:
2054         Add new files.
2055
2056         * WebProcess/WebPage/DrawingArea.h:
2057         (WebKit::DrawingArea::didUpdate):
2058         * WebProcess/WebPage/DrawingArea.messages.in:
2059         DidUpdate now takes a boolean.
2060
2061         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2062         (WebKit::sharedMemoryCache):
2063         Add shared memory cache.
2064
2065         (WebKit::DrawingAreaImpl::~DrawingAreaImpl):
2066         Return the shared memory to the cache.
2067
2068         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
2069         display now takes an extra boolean.
2070
2071         (WebKit::DrawingAreaImpl::didUpdate):
2072         Return the shared memory to the cache.
2073
2074         (WebKit::DrawingAreaImpl::display):
2075         If useSharedMemoryCache is true, get shared memory from the cache.
2076
2077         * WebProcess/WebPage/SharedMemoryCache.cpp: Added.
2078         (WebKit::SharedMemoryCache::acquireSharedMemory):
2079         If the memory we currently hold on to is big enough, return it.
2080
2081         (WebKit::SharedMemoryCache::releaseSharedMemory):
2082         If we're already holding on to shared memory, evict it if the returned
2083         shared memory object is bigger than the one we currently hold.
2084
2085         (WebKit::SharedMemoryCache::clearCacheTimerFired):
2086         Null out the shared memory object.
2087
2088 2011-03-11  Jessie Berlin  <jberlin@apple.com>
2089
2090         Reviewed by Adam Roben.
2091
2092         Crash calling WebContext::clearResourceCaches(InMemoryResourceCachesOnly) before the Web
2093         Process has finished launching.
2094         https://bugs.webkit.org/show_bug.cgi?id=56208
2095
2096         Only send the message if the Web Process is valid.
2097
2098         * UIProcess/WebContext.cpp:
2099         (WebKit::WebContext::clearResourceCaches):
2100
2101 2011-03-11  Anders Carlsson  <andersca@apple.com>
2102
2103         Reviewed by Dan Bernstein.
2104
2105         Don't paint more than 60 times per second
2106         https://bugs.webkit.org/show_bug.cgi?id=56206
2107         <rdar://problem/9085989>
2108
2109         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2110         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
2111         Initialize m_lastDisplayTime to 0. Change the display timer to call displayTimerFired.
2112
2113         (WebKit::DrawingAreaImpl::didUpdate):
2114         Call displayTimerFired instead of display.
2115
2116         (WebKit::DrawingAreaImpl::displayTimerFired):
2117         If we're asked to paint again less than 1/60th of a second after we've already painted,
2118         defer painting.
2119
2120         (WebKit::DrawingAreaImpl::display):
2121         Update m_lastDisplayTime.
2122
2123 2011-03-11  Mark Rowe  <mrowe@apple.com>
2124
2125         Reviewed by Alice Liu.
2126
2127         <rdar://problem/9120161> WKPageRestoreFromSessionState does not set the pending API request URL.
2128
2129         * UIProcess/cf/WebPageProxyCF.cpp:
2130         (WebKit::WebPageProxy::restoreFromSessionStateData): If we're navigating to a back/forward item
2131         as part of the restoration, call setPendingAPIRequestURL. When there's a provisional URL this will
2132         be done by our call to loadURL elsewhere in the function.
2133
2134 2011-03-10  Alexey Proskuryakov  <ap@apple.com>
2135
2136         Reviewed by Jon Honeycutt.
2137
2138         WebKit2 UI process crashes if web process crashes while computing page rects for printing
2139         https://bugs.webkit.org/show_bug.cgi?id=56160
2140         <rdar://problem/9027410>
2141
2142         * UIProcess/API/mac/WKPrintingView.mm:
2143         (-[WKPrintingView _suspendAutodisplay]): Added a null check for page, matching one that
2144         we have when resuming autodisplay.
2145         (-[WKPrintingView _delayedResumeAutodisplayTimerFired]): Added a FIXME.
2146         (pageDidComputePageRects): Sanitize results coming from the web process (and avoid crashing
2147         when there is a communication error, so results are all null).
2148         (-[WKPrintingView knowsPageRange:]): If there is no page any more, we can't tell how many
2149         pages it had.
2150         (-[WKPrintingView rectForPage:]): Handle the case where we are neither calculating pages
2151         nor knowing them, as it happens when the web process crashes.        
2152
2153 2011-03-10  Mark Rowe  <mrowe@apple.com>
2154
2155         Rubber-stamped by Sam Weinig.
2156
2157         Part of <rdar://problem/8728860> WebKit2 needs to be made localizable
2158
2159         The presence of CFBundleDevelopmentRegion in the application's Info.plist prevents
2160         the default localization that we set during launch from being respected.
2161
2162         * PluginProcess/Info.plist: Remove CFBundleDevelopmentRegion.
2163         * WebProcess/Info.plist: Ditto.
2164
2165 2011-03-10  Martin Robinson  <mrobinson@igalia.com>
2166
2167         Build for WebKit2 GTK+ after r80714.
2168
2169         * GNUmakefile.am: Update source list.
2170         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: 
2171         (WebKit::x11Display): Add missing semicolon.
2172
2173 2011-03-10  Chris Fleizach  <cfleizach@apple.com>
2174
2175         Reviewed by Darin Adler.
2176
2177         REGRESSION (WebKit2): VoiceOver focus no longer follows keyboard focus
2178         https://bugs.webkit.org/show_bug.cgi?id=55959
2179
2180         NSApplication has to return the focused element within the app in order
2181         for NSAccessibilityHandleFocusChanged() to work. The default implementation
2182         relies on keyWindow. Consequently, in WK2, the WebProcess must override that method
2183         to return the appropriate focused element within the WebProcess, since
2184         there is no keyWindow.
2185
2186         * WebKit2.xcodeproj/project.pbxproj:
2187         * WebProcess/WebPage/mac/AccessibilityWebPageObject.mm:
2188         (-[AccessibilityWebPageObject accessibilityFocusedUIElement]):
2189         * WebProcess/WebProcess.cpp:
2190         (WebKit::WebProcess::focusedWebPage):
2191         * WebProcess/WebProcess.h:
2192         * WebProcess/mac/NSApplicationOverride.mm: Added.
2193         (-[NSApplication accessibilityFocusedUIElement]):
2194
2195 2011-03-10  Oleg Romashin  <romaxa@gmail.com>
2196
2197         Reviewed by Andreas Kling.
2198
2199         Make Qt port compiling with ENABLE_PLUGIN_PROCESS=1, part3
2200         Solving conflict of Qt and Xlib includes
2201
2202         * Shared/Plugins/NPIdentifierData.cpp:
2203         * Shared/Plugins/NPIdentifierData.h:
2204         * Shared/Plugins/NPObjectProxy.cpp:
2205         * Shared/Plugins/NPVariantData.h:
2206
2207 2011-03-10  Sam Weinig  <sam@webkit.org>
2208
2209         Reviewed by Mark Rowe.
2210
2211         - Fix plugins in release and production builds.
2212
2213         * WebKit2.xcodeproj/project.pbxproj:
2214         Make sure to base the PluginProcess target on the correct xcconfig file
2215         in all configurations.
2216
2217 2011-03-09  Matthew Delaney  <mdelaney@apple.com>
2218
2219         Reviewed by Simon Fraser.
2220
2221         Plumb through settings for accelerated drawing for canvas
2222         https://bugs.webkit.org/show_bug.cgi?id=56039
2223
2224         * Shared/WebPreferencesStore.h:
2225         * UIProcess/API/C/WKPreferences.cpp:
2226         * UIProcess/API/C/WKPreferencesPrivate.h:
2227         * WebProcess/WebPage/WebPage.cpp:
2228
2229 2011-03-10  Jessie Berlin  <jberlin@apple.com>
2230
2231         Reviewed by Oliver Hunt and Brian Weinstein.
2232
2233         WebKit2: Need a way to clear only the in-memory resource caches
2234         https://bugs.webkit.org/show_bug.cgi?id=56022
2235
2236         Add a parameter to WKContextClearResourceCaches to specify whether to clear all the caches
2237         or just the memory caches.
2238
2239         * Shared/ResourceCachesToClear.h: Added.
2240         * UIProcess/API/C/WKAPICast.h:
2241         (WebKit::toResourceCachesToClear):
2242
2243         * UIProcess/API/C/WKContext.cpp:
2244         (WKContextClearResourceCaches):
2245         Add the new parameter.
2246         * UIProcess/API/C/WKContext.h:
2247         * UIProcess/WebContext.cpp:
2248         (WebKit::WebContext::clearResourceCaches):
2249         Ditto.
2250         * UIProcess/WebContext.h:
2251
2252         * WebProcess/WebProcess.cpp:
2253         (WebKit::WebProcess::clearResourceCaches):
2254         Pass the new parameter through to the platform-specific functions.
2255         * WebProcess/WebProcess.h:
2256         Add the new parameter and give it a default of AllResourceCaches.
2257         * WebProcess/WebProcess.messages.in:
2258         Ditto.
2259         * WebProcess/gtk/WebProcessGtk.cpp:
2260         (WebKit::WebProcess::platformClearResourceCaches):
2261         Ditto.
2262         * WebProcess/qt/WebProcessQt.cpp:
2263         (WebKit::WebProcess::platformClearResourceCaches):
2264         Ditto.
2265         * WebProcess/win/WebProcessWin.cpp:
2266         (WebKit::WebProcess::platformClearResourceCaches):
2267         When told to clear only the in-memory caches, return early so as not to clear the CFNetwork
2268         disk cache.
2269         * WebProcess/mac/WebProcessMac.mm:
2270         (WebKit::WebProcess::platformClearResourceCaches):
2271         Ditto.
2272
2273         * WebKit2.xcodeproj/project.pbxproj:
2274         Add ResourceCachesToClear.h
2275         * win/WebKit2.vcproj:
2276         Ditto.
2277
2278 2011-03-10  Jeff Miller  <jeffm@apple.com>
2279
2280         Reviewed by Adam Roben.
2281
2282         WKViewRegisterEditCommandCallback should use WKViewUndoType
2283         https://bugs.webkit.org/show_bug.cgi?id=56120
2284
2285         * UIProcess/API/C/win/WKView.h: Change undoOrRedo parameter in WKViewRegisterEditCommandCallback to be WKViewUndoType.
2286
2287 2011-03-10  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2288
2289         Reviewed by Kenneth Rohde Christiansen.
2290
2291         Tiled backing store's delegated scroll request uses incorrect convention
2292         https://bugs.webkit.org/show_bug.cgi?id=56011
2293
2294         Adapt all of the internal API to match the delta to point
2295         conversion at the WebCore side.
2296
2297         * UIProcess/API/qt/qwkpage.cpp:
2298         (QWKPagePrivate::pageDidRequestScroll):
2299         * UIProcess/API/qt/qwkpage_p.h:
2300         * UIProcess/PageClient.h:
2301         * UIProcess/WebPageProxy.cpp:
2302         (WebKit::WebPageProxy::pageDidRequestScroll):
2303         * UIProcess/WebPageProxy.h:
2304         * UIProcess/WebPageProxy.messages.in:
2305         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2306         (WebKit::WebChromeClient::delegatedScrollRequested):
2307         * WebProcess/WebCoreSupport/WebChromeClient.h:
2308         * WebProcess/WebPage/WebPage.cpp:
2309         (WebKit::WebPage::pageDidRequestScroll):
2310         * WebProcess/WebPage/WebPage.h:
2311
2312 2011-03-10  Balazs Kelemen  <kbalazs@webkit.org>
2313
2314         Reviewed by Andreas Kling.
2315
2316         [WK2] Make non-transparent windowless plugins paint on X11
2317         https://bugs.webkit.org/show_bug.cgi?id=55660
2318
2319         Implement painting for non-transparent windowless X11 plugins.
2320         The essence of the logic has been adapted from WebCore.
2321         The implementation is stubbed for GTK and working only on Qt
2322         but it should be really easy to finish it for GTK.
2323
2324         * WebKit2.pro:
2325         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2326         (WebKit::NPN_GetValue): Handle X11 specific values that are necessary.
2327         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2328         (WebKit::NetscapePlugin::NetscapePlugin): Initialize the X11 specific
2329         members that has been added.
2330         (WebKit::NetscapePlugin::callSetWindow): Always set the x and y coordinates
2331         of the NP_Window to 0 on X11 since we are using a backings store as the
2332         painting area for the plugin.
2333         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2334         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp: Removed in favour
2335         of a common implementation for X11.
2336         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp: Ditto.
2337         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: Added.
2338         (WebKit::getPluginDisplay):
2339
2340         Platform specific static getters.
2341         (WebKit::x11Display):
2342         (WebKit::displayDepth):
2343         (WebKit::rootWindowID):
2344         (WebKit::x11Screen):
2345
2346         (WebKit::NetscapePlugin::platformPostInitialize): Set up the visual
2347         settings and the colormap for the plugin.
2348         (WebKit::NetscapePlugin::platformDestroy):
2349         (WebKit::NetscapePlugin::platformInvalidate): Remained stub.
2350         (WebKit::NetscapePlugin::platformGeometryDidChange): Create a new
2351         pixmap that fits the geometry.
2352         (WebKit::NetscapePlugin::platformPaint): Propagate a paint event
2353         to the plugin, sync with it if necessary and draw the pixmap to
2354         the screen.
2355         (WebKit::toNP): Remained stub.
2356         (WebKit::NetscapePlugin::platformHandleMouseEvent): Remained stub.
2357         (WebKit::NetscapePlugin::platformHandleWheelEvent): Remained stub.
2358         (WebKit::NetscapePlugin::platformSetFocus): Remained stub.
2359         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent): Remained stub.
2360         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent): Remained stub.
2361         (WebKit::NetscapePlugin::platformHandleKeyboardEvent): Remained stub.
2362         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2363         (WebKit::WebFrameLoaderClient::createPlugin): Hack. Inject wmode=opaque
2364         key-value pair to the plugin parameters to force Flash to act in
2365         non-transparent windowless mode. Qt also doing this in WebCore.
2366
2367 2011-03-09  Peter Kasting  <pkasting@google.com>
2368
2369         Reviewed by Mihai Parparita.
2370
2371         Unify Windows version checks.
2372         https://bugs.webkit.org/show_bug.cgi?id=55979
2373
2374         * UIProcess/win/WebPageProxyWin.cpp:
2375         (WebKit::WebPageProxy::standardUserAgent):
2376
2377 2011-03-09  Adele Peterson  <adele@apple.com>
2378
2379         Reviewed by Anders Carlsson.
2380
2381         Fix for https://bugs.webkit.org/show_bug.cgi?id=56068
2382         <rdar://problem/9058245> WebKit2: Can't uncheck 'Spelling and Grammar' contextual items
2383
2384         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contextMenuItemSelected):
2385         Add cases for ContextMenuItemTagCorrectSpellingAutomatically, ContextMenuItemTagCheckSpellingWhileTyping, 
2386         and ContextMenuItemTagCheckGrammarWithSpelling
2387
2388 2011-03-09  Alexey Proskuryakov  <ap@apple.com>
2389
2390         Reviewed by Dan Bernstein.
2391
2392         Frequent crashes when printing in WebPageProxy::setAutodisplay
2393         https://bugs.webkit.org/show_bug.cgi?id=56057
2394         <rdar://problem/9053290>
2395
2396         * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView _delayedResumeAutodisplayTimerFired]):
2397         Null check the page, there is no reason for it to still exist.
2398
2399 2011-03-09  Brent Fulgham  <bfulgham@webkit.org>
2400
2401         Unreviewed build correction.
2402
2403         * UIProcess/DrawingAreaProxy.messages.in: Exclude the other
2404           method using LayerTreeContext for non-accelerated composition case.
2405
2406 2011-03-09  Sam Weinig  <sam@webkit.org>
2407
2408         Reviewed by Anders Carlsson.
2409
2410         Change plugins to use their own executable on Mac OS X
2411         https://bugs.webkit.org/show_bug.cgi?id=55991
2412
2413         * Configurations/PluginProcess.xcconfig: Copied from Source/WebKit2/Configurations/WebProcess.xcconfig.
2414         * PluginProcess/Info.plist: Copied from Source/WebKit2/WebProcess/Info.plist.
2415         Add files necessary for adding PluginProcess.app.
2416
2417         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2418         (WebKit::ProcessLauncher::launchProcess):
2419         Launch the PluginProcess.app when launching a plugin process.
2420
2421         * WebKit2.xcodeproj/project.pbxproj:
2422         Add new executable and new files, removes some unneeded copying
2423         and duplicate compiling of files.
2424
2425         * WebProcess/Info.plist:
2426         Sorted.
2427
2428 2011-03-09  Jessie Berlin  <jberlin@apple.com>
2429
2430         Reviewed by Adam Roben.
2431
2432         Use the Cookie Storage from the Private Browsing Storage Session directly
2433         https://bugs.webkit.org/show_bug.cgi?id=55986
2434
2435         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2436         (InitWebCoreSystemInterface):
2437
2438 2011-03-09  Alejandro G. Castro  <alex@igalia.com>
2439
2440         Fix compilation after r80596, add soup Download stubs.
2441
2442         * GNUmakefile.am:
2443         * WebProcess/Downloads/soup/DownloadSoup.cpp: Added.
2444         (WebKit::Download::start):
2445         (WebKit::Download::startWithHandle):
2446         (WebKit::Download::cancel):
2447         (WebKit::Download::platformInvalidate):
2448         (WebKit::Download::didDecideDestination):
2449         (WebKit::Download::platformDidFinish):
2450
2451 2011-03-09  Alejandro G. Castro  <alex@igalia.com>
2452
2453         Fix GTK+ compilation after r80619. Add WebFullScreenManager.
2454
2455         * GNUmakefile.am:
2456
2457 2011-03-08  Jer Noble  <jer.noble@apple.com>
2458
2459         Reviewed by Sam Weinig.
2460
2461         WebKit2: Plumb through the FULLSCREEN_API Chrome client calls
2462         https://bugs.webkit.org/show_bug.cgi?id=55273
2463
2464         The FULLSCREEN_API Chrome client calls need to be plumbed through from the 
2465         WebProcess to the UIProcess.  To do this, WebFullScreenManager (and Proxy)
2466         classes have been added to WebPage.
2467
2468         * DerivedSources.make: Added rules necessary to build DerivedSources for new .in files.
2469         * DerivedSources.pro: Ditto.
2470         * Platform/CoreIPC/MessageID.h: Added message types for WebFullScreenManager.
2471         * Shared/API/c/WKBase.h: Added WKFullScreenManagerRef.
2472         * Shared/APIObject.h: Added APIType for WebFullScreenManager.
2473         * UIProcess/WebFullScreenManagerProxy.cpp: Added.
2474         * UIProcess/WebFullScreenManagerProxy.h: Added.
2475         * UIProcess/WebFullScreenManagerProxy.messages.in: Added.
2476         * UIProcess/WebPageProxy.cpp:
2477         (WebKit::WebPageProxy::close): Invalidate and clear m_fullScreenManager.
2478         (WebKit::WebPageProxy::processDidCrash): Ditto.
2479         (WebKit::WebPageProxy::didReceiveMessage): Pass messages on to WebFullScreenManagerProxy.
2480         (WebKit::WebPageProxy::didReceiveSyncMessage): Ditto.
2481         (WebKit::WebPageProxy::fullScreenManager): Added. Lazy instantiation of m_fullScreenManager.
2482         * UIProcess/WebPageProxy.h:
2483         * UIProcess/WebPageProxy.messages.in:
2484         * UIProcess/WebUIClient.cpp:
2485         * UIProcess/WebUIClient.h:
2486         * WebKit2.xcodeproj/project.pbxproj: Added references to new classes in project file.
2487         * WebKit2.pro: Ditto.
2488         * win/WebKit2.vcproj: Ditto.
2489         * WebKit2.pri: Added new directories to include file path.
2490         * win/WebKit2Common.vsprops: Ditto.
2491         * WebProcess/FullScreen/WebFullScreenManager.cpp: Added.
2492         * WebProcess/FullScreen/WebFullScreenManager.h: Added.
2493         * WebProcess/FullScreen/WebFullScreenManager.messages.in: Added.
2494         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2495         (WebKit::WebChromeClient::supportsFullScreenForElement): Pass through to WebFullScreenManager.
2496         (WebKit::WebChromeClient::enterFullScreenForElement): Ditto.
2497         (WebKit::WebChromeClient::exitFullScreenForElement): Ditto.
2498         * WebProcess/WebPage/WebPage.cpp:
2499         (WebKit::WebPage::close): Invalidate and clear m_fullScreenManager.
2500         (WebKit::WebPage::fullScreenManager): Lazy instantiation of m_fullScreenManager.
2501         (WebKit::WebPage::didReceiveMessage): Pass messages through to WebFullScreenManager.
2502         * WebProcess/WebPage/WebPage.h:
2503
2504 2011-03-08  Jer Noble  <jer.noble@apple.com>
2505
2506         Reviewed by Sam Weinig.
2507
2508         WebKit2: Plumb through the "supportsFullScreen" preference.
2509         https://bugs.webkit.org/show_bug.cgi?id=55261
2510
2511         The "supportsFullScreen" preference needs to be plumbed through from
2512         the UIProcess to the WebProcess.
2513
2514         * Shared/WebPreferencesStore.h: Add a new macro entry.
2515         * UIProcess/API/C/WKPreferences.cpp: Implement preferences getter and setter.
2516         (WKPreferencesSetFullScreenEnabled):
2517         (WKPreferencesGetFullScreenEnabled):
2518         * UIProcess/API/C/WKPreferences.h:
2519         * WebProcess/WebPage/WebPage.cpp:
2520         (WebKit::WebPage::updatePreferences): Sync the fullScreenEnabled setting through to
2521             the settings object.
2522
2523 2011-03-08  Jeff Miller  <jeffm@apple.com>
2524
2525         Reviewed by Adele Peterson.
2526
2527         WebKit2: Implement Windows glue for Undo/Redo
2528         https://bugs.webkit.org/show_bug.cgi?id=55961
2529         
2530         Expose Undo/Redo infrastructure through WKView on Windows by
2531         adding an undo client as well as APIs to reapply and unapply
2532         an edit command.
2533
2534         * UIProcess/API/C/win/WKView.cpp:
2535         (WKViewSetViewUndoClient): Added.
2536         (WKViewReapplyEditCommand): Added.
2537         (WKViewUnapplyEditCommand): Added.
2538         * UIProcess/API/C/win/WKView.h: Added WKViewUndoClient, WKViewSetViewUndoClient(), and WKViewUnapplyEditCommand().
2539         * UIProcess/WebPageProxy.cpp:
2540         (WebKit::WebPageProxy::isValidEditCommand): Added, used to validated an edit command from a WKView API.
2541         * UIProcess/WebPageProxy.h: Added isValidEditCommand().
2542         * UIProcess/win/WebUndoClient.cpp: Added, APIClient for WKViewUndoClient. 
2543         (WebKit::WebUndoClient::registerEditCommand): Added.
2544         (WebKit::WebUndoClient::clearAllEditCommands): Added.
2545         * UIProcess/win/WebUndoClient.h: Added, APIClient for WKViewUndoClient.
2546         * UIProcess/win/WebView.cpp:
2547         (WebKit::WebView::initializeUndoClient): Added.
2548         (WebKit::WebView::close): Clear out undo client.
2549         (WebKit::WebView::registerEditCommand): Implemented to call through to WKViewUndoClient.
2550         (WebKit::WebView::clearAllEditCommands): Implmented to call through to WKViewUndoClient.
2551         (WebKit::WebView::reapplyEditCommand): Added.
2552         (WebKit::WebView::unapplyEditCommand): Added.
2553         * UIProcess/win/WebView.h: Added undo client support.
2554         * win/WebKit2.vcproj: Added WebUndoClient.cpp and WebUndoClient.h.
2555
2556 2011-03-08  Jeff Miller  <jeffm@apple.com>
2557
2558         Reviewed by Sam Weinig.
2559
2560         WebKit2: Expose WebEditCommandProxy in the C API on Windows
2561         https://bugs.webkit.org/show_bug.cgi?id=55962
2562         
2563         Make WebEditCommandProxy a subclass of APIObject, and define
2564         WKEditCommandRef as the type that will be exposed through the C API.
2565
2566         * Shared/API/c/win/WKBaseWin.h: Add WKEditCommandRef.
2567         * Shared/APIObject.h: Add platform-specific TypeEditCommandProxy.
2568         * UIProcess/API/C/win/WKAPICastWin.h: Add API mapping for WKEditCommandRef.
2569         * UIProcess/WebEditCommandProxy.h: Subclass WebEditCommandProxy from APIObject.
2570         (WebKit::WebEditCommandProxy::type): Added.
2571
2572 2011-03-08  Jeff Miller  <jeffm@apple.com>
2573
2574         Reviewed by Oliver Hunt.
2575
2576         WebKit2: Redo is broken
2577         https://bugs.webkit.org/show_bug.cgi?id=55978
2578         
2579         WebEditCommandProxy::unapply() and WebEditCommandProxy::reapply() were registering the wrong edit command when an undo or redo happens.
2580         For example, when we unapply(), we should register a Redo command, not an Undo command.
2581
2582         * UIProcess/WebEditCommandProxy.cpp:
2583         (WebKit::WebEditCommandProxy::unapply): Register a Redo command, not an Undo command.
2584         (WebKit::WebEditCommandProxy::reapply): Register an Undo command, not a Redo command.
2585
2586 2011-03-08  Brent Fulgham  <bfulgham@webkit.org>
2587
2588         Reviewed by Adam Roben.
2589
2590         https://bugs.webkit.org/show_bug.cgi?id=55977
2591         Refine CF/CFNet distinctions for better code sharing.
2592         1. Rename Downloads/cf/win/DownloadCFNetWin.cpp to DownloadCFWin.cpp
2593            since it does not use any CFNETWORK features.
2594         2. Create new cfnet directory.
2595         3. Move Downloads/cf/DownloadCFNet.cpp to Downloads/cfnet
2596         4. Update project file.
2597
2598         * WebProcess/Downloads/cf/DownloadCFNet.cpp: Removed.
2599         * WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp: Removed.
2600         * WebProcess/Downloads/cf/win/DownloadCFWin.cpp: Copied from WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp.
2601         * WebProcess/Downloads/cfnet: Added.
2602         * WebProcess/Downloads/cfnet/DownloadCFNet.cpp: Copied from WebProcess/Downloads/cf/DownloadCFNet.cpp.
2603         * win/WebKit2.vcproj:
2604
2605 2011-03-08  Mark Rowe  <mrowe@apple.com>
2606
2607         Reviewed by Brady Eidson.
2608
2609         <http://webkit.org/b/55976> Provisional URL should be loaded when restoring session state even if there are back / forward list entries.
2610
2611         * UIProcess/cf/WebPageProxyCF.cpp:
2612         (WebKit::WebPageProxy::restoreFromSessionStateData): If there's a provisional URL that we will load then restore the session state
2613         without navigating to the current item.
2614         * WebProcess/WebPage/WebPage.messages.in: Expose the ability to restore the session state without navigating to the current item.
2615
2616 2011-03-08  Brent Fulgham  <bfulgham@webkit.org>
2617
2618         Reviewed by Anders Carlsson.
2619
2620         https://bugs.webkit.org/show_bug.cgi?id=55956
2621         WebKit2 Changes to correct WinCairo port build
2622
2623         * Shared/LayerTreeContext.h: Don't exclude CoreIPC declarations for non-accelerated
2624           compositing case.
2625         * UIProcess/DrawingAreaProxy.h: Add "stdint.h" include needed for Cairo build.
2626         * UIProcess/DrawingAreaProxyImpl.cpp: Exclude accelerated compositing code for
2627           WinCairo build.
2628         (WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl):
2629         (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState):
2630         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
2631         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
2632         (WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState):
2633         (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState):
2634         * UIProcess/DrawingAreaProxyImpl.h: Exclude declarations for code only used when
2635           accelerated compositing is enabled.
2636         (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode):
2637         * UIProcess/win/WebView.cpp: Protect CG-specific drawing code.
2638         (WebKit::WebView::setFindIndicator):
2639         * WebProcess/Downloads/Download.h: Allow CFLite implentation to share overwrite flag,
2640           as well as destination and bundle paths.
2641         * WebProcess/Downloads/curl/DownloadCurl.cpp: Remove stub (to share CFNet implementation
2642           of file handling.  This will be moved to a common area in a future patch.)
2643         * WebProcess/WebPage/DrawingAreaImpl.cpp: Exclude accelerated-compositing paths.
2644         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
2645         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
2646         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
2647         * WebProcess/WebPage/WebPage.cpp: Protect CG-specific drawing code.
2648         (WebKit::WebPage::drawRectToPDF):
2649         (WebKit::WebPage::drawPagesToPDF):
2650         * win/WebKit2.vcproj: Exclude unused LayerTreeContext from WinCairo
2651
2652 2011-03-08  Ivan Krstić  <ike@apple.com>
2653
2654         Reviewed by Sam Weinig.
2655
2656         Re-fix: can't paste from 3rd party text editor into WebKit2 window
2657         <rdar://problem/8978624>
2658
2659         * WebProcess/com.apple.WebProcess.sb:
2660
2661 2011-03-08  Martin Robinson  <mrobinson@igalia.com>
2662
2663         Fix the WebKit2 compilation after r80578.
2664
2665         * UIProcess/gtk/WebView.cpp:
2666         (WebKit::WebView::setFocus): Added.
2667         * UIProcess/gtk/WebView.h:
2668
2669 2011-03-08  Jessie Berlin  <jberlin@apple.com>
2670
2671         Reviewed by Anders Carlsson.
2672
2673         Crash in CFNetwork visiting google.com
2674         https://bugs.webkit.org/show_bug.cgi?id=55958
2675
2676         * Shared/API/c/cf/WKURLResponseCF.cpp:
2677         (WKURLResponseCopyCFURLResponse):
2678         If the response to copy is null, return 0;
2679
2680 2011-03-08  John Sullivan  <sullivan@apple.com>
2681
2682         Reverted the patch for https://bugs.webkit.org/show_bug.cgi?id=55940
2683         
2684         The patch was insufficient, and it wasn't useful for the intended client use either.
2685
2686         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2687         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2688         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2689
2690 2011-03-08  Alejandro G. Castro  <alex@igalia.com>
2691
2692         Unreviewed, fixed GTK+ compilation after r80569.
2693
2694         * UIProcess/gtk/WebView.cpp:
2695         (WebKit::WebView::windowToScreen):
2696         * UIProcess/gtk/WebView.h:
2697
2698 2011-03-08  Chris Fleizach  <cfleizach@apple.com>
2699
2700         Reviewed by Sam Weinig.
2701
2702         WK2: Cannot set focus on an element when focus is outside of WKView
2703         https://bugs.webkit.org/show_bug.cgi?id=55281
2704
2705         * UIProcess/API/mac/PageClientImpl.h:
2706         * UIProcess/API/mac/PageClientImpl.mm:
2707         (WebKit::PageClientImpl::setFocus):
2708         * UIProcess/API/qt/qwkpage_p.h:
2709         (QWKPagePrivate::setFocus):
2710         * UIProcess/PageClient.h:
2711         * UIProcess/WebPageProxy.cpp:
2712         (WebKit::WebPageProxy::setFocus):
2713         * UIProcess/WebPageProxy.h:
2714         * UIProcess/WebPageProxy.messages.in:
2715         * UIProcess/win/WebView.h:
2716         (WebKit::WebView::setFocus):
2717         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2718         (WebKit::WebChromeClient::focus):
2719         (WebKit::WebChromeClient::unfocus):
2720
2721 2011-03-08  Jeff Miller  <jeffm@apple.com>
2722
2723         Unreviewed, fix last change so WKBaseWin.h is in alphabetical order in the project XML.
2724
2725         * win/WebKit2.vcproj: Move WKBaseWin.h to be in alphabetical order.
2726
2727 2011-03-08  Jeff Miller  <jeffm@apple.com>
2728
2729         Reviewed by Darin Adler.
2730
2731         Remove Source/WebKit2/UIProcess/API/C/win/WKBaseWin.h
2732         https://bugs.webkit.org/show_bug.cgi?id=55952
2733
2734         * UIProcess/API/C/win/WKBaseWin.h: Removed.
2735         * win/WebKit2.vcproj: Refer to the Shared version of WKBaseWin.h instead of the one in UIProcess.
2736
2737 2011-03-08  Alejandro G. Castro  <alex@igalia.com>
2738
2739         Reviewed by Martin Robinson.
2740
2741         [GTK] Add new files to compilation after r77974
2742         https://bugs.webkit.org/show_bug.cgi?id=54076
2743
2744         The commit added new code to allow passing context to policy
2745         delegate methods, we also added dummy ResourceRequest and
2746         ResourceResponse decoders until we implement them.
2747
2748         * GNUmakefile.am:
2749         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
2750         (CoreIPC::decodeResourceRequest):
2751         (CoreIPC::decodeResourceResponse):
2752
2753 2011-03-08  Chris Fleizach  <cfleizach@apple.com>
2754
2755         Reviewed by Darin Adler.
2756
2757         AX: Webkit2 not sending UAZoomFocusChanged notifications
2758         https://bugs.webkit.org/show_bug.cgi?id=55916
2759
2760         Needed to implement the windowToScreen() method so that the right frame
2761         could be calculated to send for zoom focus changes.
2762
2763         * UIProcess/API/mac/PageClientImpl.h:
2764         * UIProcess/API/mac/PageClientImpl.mm:
2765         (WebKit::PageClientImpl::windowToScreen):
2766         * UIProcess/API/qt/qwkpage.cpp:
2767         (QWKPagePrivate::windowToScreen):
2768         * UIProcess/API/qt/qwkpage_p.h:
2769         * UIProcess/PageClient.h:
2770         * UIProcess/WebPageProxy.cpp:
2771         (WebKit::WebPageProxy::windowToScreen):
2772         * UIProcess/WebPageProxy.h:
2773         * UIProcess/WebPageProxy.messages.in:
2774         * UIProcess/win/WebView.cpp:
2775         (WebKit::WebView::windowToScreen):
2776         * UIProcess/win/WebView.h:
2777         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2778         (WebKit::WebChromeClient::windowToScreen):
2779         * WebProcess/WebPage/WebPage.cpp:
2780         (WebKit::WebPage::windowToScreen):
2781         * WebProcess/WebPage/WebPage.h:
2782
2783 2011-03-08  John Sullivan  <sullivan@apple.com>
2784
2785         Reviewed by Darin Adler.
2786
2787         https://bugs.webkit.org/show_bug.cgi?id=55940
2788         WebKit2 should support Ignore policy from injected bundle client
2789
2790         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2791         Added WKBundlePagePolicyActionIgnore.
2792         
2793         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2794         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2795         If the injected bundle client returns WKBundlePagePolicyActionIgnore, convert it
2796         to the loader's PolicyIgnore.
2797
2798 2011-03-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2799
2800         Reviewed by Kenneth Rohde Christiansen.
2801
2802         [Qt] [Symbian] [WK2] Fix building WebKit 2 API tests
2803         https://bugs.webkit.org/show_bug.cgi?id=55876
2804
2805         Make sure TESTS_SOURCE_DIR is set for Symbian the same way
2806         as it is for WK1.
2807
2808         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp:
2809         (tst_QGraphicsWKView::loadEmptyPage):
2810         * UIProcess/API/qt/tests/tests.pri:
2811
2812 2011-03-07  Damian Kaleta  <dkaleta@apple.com>
2813
2814         Reviewed by Anders Carlsson.
2815
2816         QuickTime plugin should opt in to a 32-bit non-executable heap
2817         https://bugs.webkit.org/show_bug.cgi?id=55704
2818         <rdar://problem/8105706>
2819
2820         * UIProcess/Plugins/PluginProcessProxy.cpp:
2821         (WebKit::pluginNeedsExecutableHeap): Decides per plugin if it should opt-in to a 32-bit non-executable heap.
2822         By default it should opt-out.
2823         (WebKit::PluginProcessProxy::PluginProcessProxy):
2824
2825 2011-03-07  Sam Weinig  <sam@webkit.org>
2826
2827         Reviewed by Anders Carlsson.
2828
2829         Add unableToImplementPolicy callback for WebKit2 policy client
2830         <rdar://problem/9071902>
2831         https://bugs.webkit.org/show_bug.cgi?id=55884
2832
2833         * UIProcess/API/C/WKPage.h:
2834         * UIProcess/WebPageProxy.cpp:
2835         (WebKit::WebPageProxy::unableToImplementPolicy):
2836         * UIProcess/WebPageProxy.h:
2837         * UIProcess/WebPageProxy.messages.in:
2838         * UIProcess/WebPolicyClient.cpp:
2839         (WebKit::WebPolicyClient::unableToImplementPolicy):
2840         * UIProcess/WebPolicyClient.h:
2841         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2842         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
2843         (WebKit::InjectedBundlePagePolicyClient::unableToImplementPolicy):
2844         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
2845         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2846         (WebKit::WebFrameLoaderClient::dispatchUnableToImplementPolicy):
2847         Pipe unableToImplementPolicy through both the bundle and the main WebKit2 API.
2848
2849 2011-03-07  Sam Weinig  <sam@webkit.org>
2850
2851         Reviewed by Anders Carlsson.
2852
2853         Replace WebKit2's decidePolicyForMIMEType with decidePolicyForResponse
2854         https://bugs.webkit.org/show_bug.cgi?id=55827
2855
2856         - Renamed FrameLoaderClient::dispatchDecidePolicyForMIMEType to dispatchDecidePolicyForResponse
2857           and pass the entire response, instead of just the MIMEType.
2858         - Updated both UIProcess API and bundle API to also be based on the whole response, not just the
2859           MIMEType.
2860
2861         * UIProcess/API/C/WKPage.h:
2862         * UIProcess/WebPageProxy.cpp:
2863         (WebKit::WebPageProxy::decidePolicyForResponse):
2864         * UIProcess/WebPageProxy.h:
2865         * UIProcess/WebPageProxy.messages.in:
2866         * UIProcess/WebPolicyClient.cpp:
2867         (WebKit::WebPolicyClient::decidePolicyForResponse):
2868         * UIProcess/WebPolicyClient.h:
2869         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2870         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
2871         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForResponse):
2872         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
2873         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2874         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2875         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2876
2877 2011-03-06  Jessie Berlin  <jberlin@apple.com>
2878
2879         Reviewed by Sam Weinig.
2880
2881         WebKit2: Use CFNetwork Sessions API.
2882         https://bugs.webkit.org/show_bug.cgi?id=55435.
2883
2884         When Private Browsing is enabled, use cookies from a in-memory cookie storage based on the
2885         Private Browsing Storage Session.
2886
2887         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2888         (InitWebCoreSystemInterface):
2889         Add support for using the new WKSI functions in WebCore.
2890
2891 2011-03-06  Oleg Romashin  <romaxa@gmail.com>
2892
2893         Reviewed by Kenneth Rohde Christiansen.
2894
2895         [Qt][WK2] Make Qt port compiling with ENABLE_PLUGIN_PROCESS=1, part1
2896         Adding dummy Qt files for Plugin Process implementation,
2897         Adding missing sources into Qt pro files
2898         https://bugs.webkit.org/show_bug.cgi?id=55719
2899
2900         * DerivedSources.pro:
2901         * PluginProcess/qt: Added.
2902         * PluginProcess/qt/PluginControllerProxyQt.cpp: Added.
2903         (WebKit::PluginControllerProxy::platformInitialize):
2904         (WebKit::PluginControllerProxy::platformDestroy):
2905         (WebKit::PluginControllerProxy::platformGeometryDidChange):
2906         * PluginProcess/qt/PluginProcessMainQt.cpp: Added.
2907         (WebKit::PluginProcessMain):
2908         * PluginProcess/qt/PluginProcessQt.cpp: Added.
2909         (WebKit::PluginProcess::platformInitialize):
2910         * UIProcess/Plugins/qt/PluginProcessProxyQt.cpp: Added.
2911         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
2912         * WebKit2.pri:
2913         * WebKit2.pro:
2914         * WebKit2API.pri:
2915         * WebProcess/Plugins/Netscape/qt/PluginProxyQt.cpp: Added.
2916         (WebKit::PluginProxy::needsBackingStore):
2917
2918 2011-03-05  Sam Weinig  <sam@webkit.org>
2919
2920         Reviewed by Dan Bernstein.
2921
2922         Remove unneeded onPageClose function from DrawingArea
2923         https://bugs.webkit.org/show_bug.cgi?id=55836
2924
2925         * WebProcess/WebPage/DrawingArea.h:
2926         Remove empty function.
2927
2928         * WebProcess/WebPage/WebPage.cpp:
2929         (WebKit::WebPage::close):
2930         Remove only called
2931
2932 2011-03-04  Jon Honeycutt  <jhoneycutt@apple.com>
2933
2934         WK2 Mac build fix.
2935
2936         * UIProcess/API/C/WKPage.cpp:
2937         (WKPageComputePagesForPrinting):
2938         (WKPageBeginPrinting):
2939
2940         * UIProcess/API/C/WKPagePrivate.h:
2941
2942 2011-03-04  Jon Honeycutt  <jhoneycutt@apple.com>
2943
2944         WK2 Mac build fix.
2945
2946         * UIProcess/API/C/WKPagePrivate.h:
2947
2948 2011-03-04  Jon Honeycutt  <jhoneycutt@apple.com>
2949
2950         WK2 needs printing support on Windows
2951         https://bugs.webkit.org/show_bug.cgi?id=55800
2952         <rdar://problem/8903808>
2953
2954         Reviewed by Darin Adler.
2955
2956         * UIProcess/API/C/WKPage.cpp:
2957         (ComputedPagesContext::ComputedPagesContext):
2958         (computedPagesCallback):
2959         From the Vector of WebCore::IntRects, build up a Vector of WKRects.
2960         Call the callback, passing these rects and the scale factor.
2961         (printInfoFromWKPrintInfo):
2962         Return a PrintInfo structure from the WKPrintInfo.
2963         (WKPageComputePagesForPrinting):
2964         Call WebPageProxy::computePagesForPrinting(). Pass
2965         computedPagesCallback as the callback function, so that we can
2966         translate the WebCore rect type to WKRect before calling the caller's
2967         callback function.
2968         (WKPageBeginPrinting):
2969         Call WebPageProxy::beginPrinting().
2970         (WKPageDrawPagesToPDF):
2971         Call WebPageProxy::drawPagesToPDF().
2972
2973         * UIProcess/API/C/WKPagePrivate.h:
2974         Declare the WKPrintInfo type and new functions.
2975
2976         * UIProcess/WebPageProxy.cpp:
2977         Compile this code on Windows.
2978
2979         * UIProcess/WebPageProxy.h:
2980         Ditto.
2981
2982         * UIProcess/win/WebView.cpp:
2983         (WebKit::WebView::paint):
2984         We're painting the window; leave printing mode.
2985
2986         * WebProcess/WebPage/WebPage.cpp:
2987         Compile this code on Windows.
2988
2989         * WebProcess/WebPage/WebPage.h:
2990         Ditto.
2991
2992         * WebProcess/WebPage/WebPage.messages.in:
2993         Ditto.
2994
2995 2011-03-04  Steve Falkenburg  <sfalken@apple.com>
2996
2997         Reviewed by Darin Adler.
2998
2999         Adopt VersionStamper tool for Windows WebKit DLLs
3000         https://bugs.webkit.org/show_bug.cgi?id=55784
3001         <rdar://problem/9021320>
3002
3003         We now use a tool to stamp the version number onto the Apple WebKit DLLs
3004         during the post-build step.
3005
3006         Fetch the WebKit version from a string resource instead of the version resource.
3007
3008         * UIProcess/win/WebPageProxyWin.cpp:
3009         (WebKit::userVisibleWebKitVersionString): Fetch version from a string resource.
3010         * win/WebKit2.rc: Removed version, added stringtable.
3011         * win/WebKit2WebProcess.rc: Removed.
3012         * win/WebKit2WebProcess.vcproj:
3013         * win/WebKit2WebProcessPostBuild.cmd: Don't run autoversion script. It isn't used in this project.
3014         * win/WebKit2WebProcessPreBuild.cmd: Stamp version.
3015         * win/WebKitPostBuild.cmd: Stamp version.
3016
3017 2011-03-04  Jeff Miller  <jeffm@apple.com>
3018
3019         Reviewed by Darin Adler.
3020
3021         Add WKPageValidateCommand()
3022         https://bugs.webkit.org/show_bug.cgi?id=55793
3023         
3024         On the Mac, validation of edit menu commands is handled within WebKit2 in WKView.mm.
3025         However, on Windows we need to do this in the client, so expose this functionality
3026         in the API via WKPageValidateCommand().
3027         
3028         Change the Mac implementation to call WebPageProxy::validateCommand() with a callback
3029         to match this new API, so it no longer has to go through PageClient to get notified
3030         when a command is validated.  This makes PageClient::setEditCommandState() obsolete,
3031         so I removed the stub implementations in qt and gtk as well.
3032
3033         * UIProcess/API/C/WKPage.cpp:
3034         (WKPageValidateCommand): Added.
3035         * UIProcess/API/C/WKPage.h: Added WKPageValidateCommand().
3036         * UIProcess/API/mac/PageClientImpl.h: Removed setEditCommandState().
3037         * UIProcess/API/mac/PageClientImpl.mm: Removed setEditCommandState().
3038         * UIProcess/API/mac/WKView.mm:
3039         (validateCommandCallback): Added.
3040         (-[WKView validateUserInterfaceItem:]): Pass callback to validateCommand().
3041         * UIProcess/API/qt/qwkpage.cpp: Removed setEditCommandState().
3042         * UIProcess/API/qt/qwkpage_p.h: Removed setEditCommandState().
3043         * UIProcess/PageClient.h: Removed setEditCommandState().
3044         * UIProcess/WebPageProxy.cpp: Removed didValidateCommand().
3045         (WebKit::WebPageProxy::validateCommand): This now takes a callback.
3046         (WebKit::WebPageProxy::validateCommandCallback): Added.
3047         (WebKit::WebPageProxy::processDidCrash): Invalidate m_validateCommandCallbacks.
3048         * UIProcess/WebPageProxy.h: Removed didValidateCommand(), validateCommand() now takes a callback.
3049         (WebKit::ValidateCommandCallback::create): Added.
3050         (WebKit::ValidateCommandCallback::~ValidateCommandCallback): Added.
3051         (WebKit::ValidateCommandCallback::performCallbackWithReturnValue): Added.
3052         (WebKit::ValidateCommandCallback::invalidate): Added.
3053         (WebKit::ValidateCommandCallback::ValidateCommandCallback): Added.
3054         * UIProcess/WebPageProxy.messages.in: Removed DidValidateCommand, added ValidateCommandCallback.
3055         * UIProcess/gtk/WebView.cpp: Removed setEditCommandState().
3056         * UIProcess/gtk/WebView.h: Removed setEditCommandState().
3057         * UIProcess/win/WebView.cpp: Removed setEditCommandState().
3058         * UIProcess/win/WebView.h: Removed setEditCommandState().
3059         * WebProcess/WebPage/WebPage.cpp:
3060         (WebKit::WebPage::validateCommand): This now takes a callbackID.
3061         * WebProcess/WebPage/WebPage.h: validateCommand now takes a callbackID.
3062         * WebProcess/WebPage/WebPage.messages.in: ValidateCommand now takes a callbackID.
3063
3064 2011-03-04  Brian Weinstein  <bweinstein@apple.com>
3065
3066         Reviewed by Darin Adler.
3067
3068         Reference-counting for WKBundlePageResourceLoadClient::willSendRequestForFrame seems unclear/wrong
3069         https://bugs.webkit.org/show_bug.cgi?id=53919
3070         <rdar://problem/8966020>
3071         
3072         Adopt the result of m_client.willSendRequestForFrame (which will be leaked by the client).
3073
3074         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
3075         (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame):
3076
3077 2011-03-04  Darin Adler  <darin@apple.com>
3078
3079         Reviewed by Mark Rowe.
3080
3081         WebKit2 session state should include even loads too new to be in the back/forward list
3082         https://bugs.webkit.org/show_bug.cgi?id=55781
3083         part of <rdar://problem/8968847>
3084
3085         * UIProcess/cf/WebPageProxyCF.cpp:
3086         (WebKit::WebPageProxy::sessionStateData): Save URLs that are early enough in the loading
3087         process to not be included in the back/forward list yet: The pending API request URL and
3088         the provisional URL.
3089         (WebKit::WebPageProxy::restoreFromSessionStateData): Call loadURL if the back/forward
3090         list is not restored and a URL is present. Later we can improve the way we handle the
3091         case where we have both a back/forward list and a URL.
3092
3093 2011-03-04  Jessie Berlin  <jberlin@apple.com>
3094
3095         Reviewed by Darin Adler.
3096
3097         WebKit2: Use CFNetwork Sessions API.
3098         https://bugs.webkit.org/show_bug.cgi?id=55435.
3099
3100         Add in the CFURLSTORAGESESSIONS guards that I incorrectly left out because the code was
3101         contained within guards that made USE(CFURLSTORAGESESSIONS) always be true.
3102
3103         * UIProcess/mac/WebContextMac.mm:
3104         (WebKit::WebContext::platformInitializeWebProcess):
3105         * UIProcess/win/WebContextWin.cpp:
3106         (WebKit::WebContext::platformInitializeWebProcess):
3107
3108 2011-03-04  Jessie Berlin  <jberlin@apple.com>
3109
3110         Reviewed by Maciej Stachowiak.
3111
3112         WebKit2: Use CFNetwork Sessions API.
3113         https://bugs.webkit.org/show_bug.cgi?id=55435.
3114
3115         When Private Browsing is enabled, get the cached url response from the cache associated with
3116         the Private Browsing Storage Session.
3117
3118         * WebProcess/WebPage/mac/WebPageMac.mm:
3119         (WebKit::WebPage::platformHasLocalDataForURL):
3120         If Private Browsing is enabled, call into WKSI to get the response.
3121         (WebKit::WebPage::cachedResponseMIMETypeForURL):
3122         Ditto.
3123         * WebProcess/WebPage/win/WebPageWin.cpp:
3124         (WebKit::WebPage::platformHasLocalDataForURL):
3125         If Private Browsing is enabled, call into WKSI to get the CFURLCacheRef.
3126         (WebKit::WebPage::cachedResponseMIMETypeForURL):
3127         Ditto.
3128
3129 2011-03-04  Jeff Miller  <jeffm@apple.com>
3130
3131         Reviewed by Darin Adler.
3132
3133         Move WKViewExecuteCommand() to WKPageExecuteCommand()
3134         https://bugs.webkit.org/show_bug.cgi?id=55744
3135         
3136         Executing a command operates on a page, so it makes more sense for it to be in WKPage.
3137         This also makes it available on all platforms, not just Windows.
3138
3139         * UIProcess/API/C/WKPage.cpp:
3140         (WKPageExecuteCommand): Added.
3141         * UIProcess/API/C/WKPage.h: Add WKPageExecuteCommand().
3142         * UIProcess/API/C/win/WKView.cpp: Remove WKViewExecuteCommand().
3143         * UIProcess/API/C/win/WKView.h: Remove WKViewExecuteCommand().
3144
3145 2011-03-04  Dan Bernstein  <mitz@apple.com>
3146
3147         LLVM Compiler build fix.
3148
3149         * WebProcess/WebPage/WebPage.cpp:
3150         (WebKit::WebPage::runJavaScriptInMainFrame):
3151
3152 2011-03-03  Timothy Hatcher  <timothy@apple.com>
3153
3154         Make the WKPageRunJavaScriptFunction callback take a WKSerializedScriptValueRef.
3155
3156         https://webkit.org/b/55623
3157
3158         Reviewed by Darin Adler.
3159
3160         * UIProcess/API/C/WKPage.cpp:
3161         (WKPageRunJavaScriptInMainFrame): Use ScriptValueCallback.
3162         (callRunJavaScriptBlockAndRelease): Use WKSerializedScriptValueRef.
3163         * UIProcess/API/C/WKPage.h: Use WKSerializedScriptValueRef.
3164         * UIProcess/WebPageProxy.cpp:
3165         (WebKit::WebPageProxy::close): Call invalidateCallbackMap for m_scriptValueCallbacks.
3166         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Take a ScriptValueCallback.
3167         (WebKit::WebPageProxy::scriptValueCallback): Added. Create a WebSerializedScriptValue
3168         from the DataReference before calling the callback.
3169         (WebKit::WebPageProxy::processDidCrash): Call invalidateCallbackMap for m_scriptValueCallbacks.
3170         * UIProcess/WebPageProxy.h: Added ScriptValueCallback and m_scriptValueCallbacks.
3171         * UIProcess/WebPageProxy.messages.in: Added ScriptValueCallback.
3172         * WebProcess/WebPage/WebPage.cpp:
3173         (WebKit::WebPage::runJavaScriptInMainFrame): Create a DataReference from a WebCore::SerializedScriptValue.
3174         And use ScriptValueCallback to send the message back.
3175
3176 2011-03-03  Brian Weinstein  <bweinstein@apple.com>
3177
3178         Reviewed by Adam Roben.
3179
3180         Cleanup from https://bugs.webkit.org/show_bug.cgi?id=55427.
3181         
3182         Call WebCore::startObservingCookieChanges and WebCore::stopObservingCookieChanges
3183         on all platforms, and stub the functions on platforms that don't implement them.
3184
3185         * WebProcess/Cookies/WebCookieManager.cpp:
3186         (WebKit::WebCookieManager::startObservingCookieChanges):
3187         (WebKit::WebCookieManager::stopObservingCookieChanges):
3188
3189 2011-03-03  Jeff Miller  <jeffm@apple.com>
3190
3191         Reviewed by Darin Adler.
3192
3193         Refactor classes in GenericCallback.h
3194         https://bugs.webkit.org/show_bug.cgi?id=55732
3195         
3196         Since we're going to need to add additional callback classes, make a CallbackBase class that manages
3197         the context and the callback ID.  The existing callback classes (VoidCallback, GenericCallback, and
3198         ComputedPagesCallback) now all derive from CallbackBase.
3199         
3200         Fix bug in VoidCallback where we meant to implement the destructor, but we were implementing the default
3201         constructor instead (we forgot the leading ~).
3202  
3203         * UIProcess/GenericCallback.h:
3204         (WebKit::CallbackBase::~CallbackBase):
3205         (WebKit::CallbackBase::callbackID):
3206         (WebKit::CallbackBase::CallbackBase):
3207         (WebKit::CallbackBase::context):
3208         (WebKit::CallbackBase::generateCallbackID):
3209         (WebKit::VoidCallback::~VoidCallback):
3210         (WebKit::VoidCallback::performCallback):
3211         (WebKit::VoidCallback::invalidate):
3212         (WebKit::VoidCallback::VoidCallback):
3213         (WebKit::GenericCallback::create):
3214         (WebKit::GenericCallback::~GenericCallback):
3215         (WebKit::GenericCallback::performCallbackWithReturnValue):
3216         (WebKit::GenericCallback::invalidate):
3217         (WebKit::GenericCallback::GenericCallback):
3218         (WebKit::ComputedPagesCallback::create):
3219         (WebKit::ComputedPagesCallback::~ComputedPagesCallback):
3220         (WebKit::ComputedPagesCallback::performCallbackWithReturnValue):
3221         (WebKit::ComputedPagesCallback::invalidate):
3222         (WebKit::ComputedPagesCallback::ComputedPagesCallback):
3223
3224 2011-03-03  Adam Roben  <aroben@apple.com>
3225
3226         Don't assume the web process has had a chance to paint before the view has to paint
3227
3228         Fixes <http://webkit.org/b/55739> REGRESSION (r80307): Lots of tests crashing in
3229         BackingStore::paint
3230
3231         Reviewed by Anders Carlsson.
3232
3233         * UIProcess/DrawingAreaProxyImpl.cpp:
3234         (WebKit::DrawingAreaProxyImpl::paint): Bail if the web process hasn't had a chance to paint
3235         yet.
3236
3237 2011-03-03  Adam Roben  <aroben@apple.com>
3238
3239         Throw away DrawingAreaProxyImpl's backing store after not painting for 5 seconds
3240
3241         The intent is to save memory for views that aren't painting.
3242
3243         Fixes <http://webkit.org/b/51262> <rdar://problem/8782537> WebPageProxy should delete its
3244         backing store after not painting for a while
3245
3246         Reviewed by Anders Carlsson.
3247
3248         * UIProcess/DrawingAreaProxyImpl.cpp:
3249         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): Initialize our timer.
3250         (WebKit::DrawingAreaProxyImpl::paint): Don't bail if we don't have a backing store (but do
3251         bail if we're in accelerated compositing mode); we might have thrown it away to save memory
3252         but now are being asked to paint by the view. The existing code in this function will handle
3253         getting a new backing store if possible by blocking for a little while to try to receive a
3254         DidUpdateBackingStoreState message. Added an assertion that we do have a backing store if we
3255         don't have any outstanding UpdateBackingStoreState requests. After painting, call
3256         discardBackingStoreSoon to update our timer.
3257         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon): Set the timer for 5 seconds in the
3258         future.
3259         (WebKit::DrawingAreaProxyImpl::discardBackingStore): Throw away the backing store, and tell
3260         the web process we'll need a full backing store update on the next paint.
3261
3262         * UIProcess/DrawingAreaProxyImpl.h: Added m_discardBackingStoreTimer.
3263
3264 2011-03-03  Adam Roben  <aroben@apple.com>
3265
3266         Add a way to tell the web process to perform a full backing store update on its next paint
3267
3268         Messages::DrawingArea::UpdateBackingStoreState now takes a boolean specifying whether the
3269         full backing store update should happen immediately or should be deferred until the next
3270         paint or compositing mode change occurs. The deferred update isn't used yet, but will be
3271         used when we start throwing away backing stores to save memory.
3272
3273         Fixes <http://webkit.org/b/55730> UI process needs a way to tell the web process its backing
3274         store needs a full update on the next paint
3275
3276         Reviewed by Anders Carlsson.
3277
3278         * UIProcess/DrawingAreaProxyImpl.cpp:
3279         (WebKit::DrawingAreaProxyImpl::paint): If we have an outstanding backing store state change
3280         request, tell the web process to perform the backing store update right away, in case we
3281         previously told it it could defer the update.
3282         (WebKit::DrawingAreaProxyImpl::sizeDidChange): Specify that we need an immediate backing
3283         store update.
3284         (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState): We can no longer assert that we
3285         were waiting for a DidUpdateBackingStoreState message when we receive one, as it's possible
3286         for the web process to decide to send us this message on its own (if we asked it to do a
3287         deferred backing store update and then it needed to paint some part of the page). Specify
3288         that we need an immediate backing store update if the web process hasn't updated to our
3289         latest state, as we're about to draw potentially out-of-date bits to the screen and want to
3290         get the right bits as soon as possible. Also added a FIXME about a potential optimization.
3291         (WebKit::DrawingAreaProxyImpl::backingStoreStateDidChange): Added a RespondImmediatelyOrNot
3292         parameter, which is just passed through to sendUpdateBackingStoreState.
3293         (WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState): Added a RespondImmediatelyOrNot
3294         parameter that is used to specify to the web process whether to perform the full backing
3295         store update immediately. We now only wait for a DidUpdateBackingStoreState message (and
3296         thus suppress any more UpdateBackingStoreState messages until one is received) when we ask
3297         the web process for an immediate response; otherwise we could end up accidentally calling
3298         waitForAndDispatchDidUpdateBackingStoreState when the web process hasn't been told to send
3299         us such a message.
3300
3301         * UIProcess/DrawingAreaProxyImpl.h: Added RespondImmediatelyOrNot.
3302
3303         * WebProcess/WebPage/DrawingArea.h:
3304         (WebKit::DrawingArea::updateBackingStoreState): Added respondImmediately argument.
3305
3306         * WebProcess/WebPage/DrawingArea.messages.in: Added respondImmediately argument to
3307         UpdateBackingStoreState message.
3308
3309         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3310         (WebKit::DrawingAreaImpl::DrawingAreaImpl): Initialize new member that's used to track
3311         whether we should send a DidUpdateBackingStoreState message instead of an Update or
3312         compositing mode change message. This will be set to true when a deferred backing store
3313         update is pending.
3314         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers): If a deferred update is pending, send a
3315         DidUpdateBackingStoreState message instead of a compositing mode change message.
3316         (WebKit::DrawingAreaImpl::updateBackingStoreState): Added respondImmediately argument. If
3317         we've already been told about this state ID (as can happen when the UI process decides it
3318         needs an immediate update to a state that it previously requested a deferred update to),
3319         don't bother updating the page's size, etc. In addition, if we've already sent a
3320         DidUpdateBackingStoreState message for this state, we don't have to do anything at all.
3321         Moved code to send the DidUpdateBackingStoreState message from here...
3322         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): ...to here.
3323         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Always update our dirty region,
3324         even if painting is suspended or we're in the process of updating the backing store state.
3325         It causes no harm and simplifies the code. If a deferred update is pending, send a
3326         DidUpdateBackingStoreState message instead of a compositing mode change message. Also
3327         removed a redundant if.
3328         (WebKit::DrawingAreaImpl::display): Added an assertion that this isn't called while updating
3329         backing store state, as otherwise we might end up sending two DidUpdateBackingStoreState
3330         messages. If a deferred update is pending, send a DidUpdateBackingStoreState message instead
3331         of an Update message.
3332
3333         * WebProcess/WebPage/DrawingAreaImpl.h: Updated updateBackingStoreState to match the base
3334         class. Added sendDidUpdateBackingStoreState and m_shouldSendDidUpdateBackingStoreState.
3335
3336 2011-03-03  Andy Estes  <aestes@apple.com>
3337
3338         Reviewed by Darin Adler.
3339
3340         When displaying the missing plug-in sheet, pass the 'pluginspage'
3341         attribute to the UI process.
3342         https://bugs.webkit.org/show_bug.cgi?id=55553
3343
3344         * UIProcess/API/C/WKPage.h: Add pluginsPageURL as the third argument to
3345         missingPluginButtonClicked.
3346         * UIProcess/WebPageProxy.cpp:
3347         (WebKit::WebPageProxy::missingPluginButtonClicked): Ditto.
3348         * UIProcess/WebPageProxy.h: Ditto.
3349         * UIProcess/WebPageProxy.messages.in: Ditto.
3350         * UIProcess/WebUIClient.cpp:
3351         (WebKit::WebUIClient::missingPluginButtonClicked): Ditto.
3352         * UIProcess/WebUIClient.h: Ditto.
3353         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3354         (WebKit::WebChromeClient::missingPluginButtonClicked): Get the value of
3355         pluginspageAttr.
3356
3357 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
3358
3359         Suggested by Dan Bernstein.
3360
3361         Move "const" around "NSString *", so that it suddenly begins to make sense.
3362
3363         * WebProcess/mac/FullKeyboardAccessWatcher.mm:
3364
3365 2011-03-03  Jeff Miller  <jeffm@apple.com>
3366
3367         Reviewed by Anders Carlsson.
3368
3369         WebKit2: Add WKViewRef API for executing edit commands
3370         https://bugs.webkit.org/show_bug.cgi?id=49829
3371
3372         Added WKViewExecuteCommand() and documented some of the WebCore EditorCommand strings.
3373
3374         * UIProcess/API/C/win/WKView.cpp:
3375         (WKViewExecuteCommand): Added.
3376         * UIProcess/API/C/win/WKView.h: Added WKViewExecuteCommand() and comment block with WebCore EditorCommand strings.
3377
3378 2011-03-03  Jessie Berlin  <jberlin@apple.com>
3379
3380         Reviewed by Adam Roben.
3381
3382         WebKit2: Use CFNetwork Sessions API.
3383         https://bugs.webkit.org/show_bug.cgi?id=55435
3384
3385         Set the Private Browsing Storage Session on requests when Private Browsing is enabled.
3386
3387         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3388         (InitWebCoreSystemInterface):
3389         Support using WKCopyRequestWithStorageSession in WebCore.
3390
3391 2011-03-03  Adam Roben  <aroben@apple.com>
3392
3393         Don't try to paint outside the page's bounds
3394
3395         When the page is resized smaller, we would allocate a ShareableBitmap at the old, larger
3396         size, even though we only needed to paint at the new, smaller size.
3397
3398         The assertion added in this patch will fire during the WebKit2/ResizeViewWhileHidden API
3399         test if this fix gets broken in the future.
3400
3401         Fixes <http://webkit.org/b/55715> DrawingAreaImpl allocates more memory than necessary when
3402         the page is resized smaller
3403
3404         Reviewed by Anders Carlsson.
3405
3406         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3407         (WebKit::DrawingAreaImpl::updateBackingStoreState): Update our dirty region even if painting
3408         is suspended (but still refrain from updating it when in accelerated compositing mode).
3409         Rather than unite our existing dirty region with the page's new bounds, overwrite our dirty
3410         region with the page's new bounds. This prevents us from accumulating a dirty region that is
3411         larger than the page in the case where the page is being resized smaller.
3412         (WebKit::DrawingAreaImpl::display): Added an assertion that we're not trying to paint
3413         outside of the page's bounds.
3414
3415 2011-03-03  Maciej Stachowiak  <mjs@apple.com>
3416
3417         Reviewed by Brady Eidson.
3418
3419         WebProcess is calling CFURLCacheRemoveAllCachedResponses when loading, results in origin-load for all resources
3420         https://bugs.webkit.org/show_bug.cgi?id=55701
3421         <rdar://problem/9074017>
3422
3423         * Shared/WebProcessCreationParameters.cpp:
3424         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Initialize cache-clearing
3425         flag parameters to false.
3426         (WebKit::WebProcessCreationParameters::encode): Serialize them properly.
3427         (WebKit::WebProcessCreationParameters::decode): And deserialize.
3428
3429 2011-03-03  Alexey Proskuryakov  <ap@apple.com>
3430
3431         Reviewed by Darin Adler.
3432
3433         REGRESSION (WebKit2): Tab keys no longer observe Full Keyboard Access
3434         https://bugs.webkit.org/show_bug.cgi?id=55633
3435         <rdar://problem/8963023>
3436
3437         * WebKit2.xcodeproj/project.pbxproj:
3438         * WebProcess/mac/FullKeyboardAccessWatcher.h: Added.
3439         * WebProcess/mac/FullKeyboardAccessWatcher.mm: Added.
3440         (-[FullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
3441         (-[FullKeyboardAccessWatcher init]):
3442         (+[FullKeyboardAccessWatcher fullKeyboardAccessEnabled]):
3443         Get the current state of full keyboard access, listening for change notifications.
3444
3445         * WebProcess/WebProcess.h:  Added fullKeyboardAccessEnabled().
3446
3447         * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fullKeyboardAccessEnabled):
3448         WebKit1 also doesn't implement this on platforms other than Mac.
3449
3450         * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::fullKeyboardAccessEnabled):
3451         Just ask FullKeyboardAccessWatcher.
3452
3453         * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::keyboardUIMode):
3454         * WebProcess/WebCoreSupport/WebChromeClient.h:
3455         Added keyboardUIMode(), removed tabsToLinks().
3456
3457         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::keyboardUIMode):
3458         * WebProcess/WebPage/WebPage.h:
3459         Generate keyboard UI mode from tabToLinks preference and current state of FKA.
3460
3461 2011-03-03  Sam Weinig  <sam@webkit.org>
3462
3463         Reviewed by Anders Carlsson.
3464
3465         Give the Bundle's policy client the option of deciding the policy
3466         https://bugs.webkit.org/show_bug.cgi?id=55699
3467
3468         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
3469         Add WKBundlePagePolicyAction enum and make it the return value of
3470         the WKBundlePagePolicyClient functions.
3471
3472         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
3473         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction):
3474         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction):
3475         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForMIMEType):
3476         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
3477         Pass the return value back to the caller. For unimplemented functions, return WKBundlePagePolicyActionPassThrough.
3478
3479         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3480         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
3481         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3482         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3483         Call the policy function early if the bundle handles it.
3484
3485 2011-03-02  Brian Weinstein  <bweinstein@apple.com>
3486
3487         Reviewed by Adam Roben.
3488
3489         Rest of WebKit2: Need a way to send notifications to client when cookies change
3490         https://bugs.webkit.org/show_bug.cgi?id=55427
3491         <rdar://problem/9056027>
3492         
3493         This patch adds the communication from the WebProcess <-> UIProcess about starting/stopping
3494         listening for cookies changing, and adds a mechanism for the WebProcess to notify the UIProcess
3495         when the cookies have changed. The WebProcess sends a message to the UIProcess when the cookies
3496         change, and the UIProcess passes this along to the WebCookieManagerProxyClient.
3497
3498         * UIProcess/API/C/WKCookieManager.cpp:
3499         (WKCookieManagerSetClient): Call through to WebCookieManagerProxy.
3500         (WKCookieManagerStartObservingCookieChanges): Ditto.
3501         (WKCookieManagerStopObservingCookieChanges): Ditto.
3502
3503         * UIProcess/API/C/WKCookieManager.h: Add new functions and a WKCookieManagerClient
3504             which is responsible for cookiesDidChange.
3505
3506         * UIProcess/WebCookieManagerProxy.cpp:
3507         (WebKit::WebCookieManagerProxy::initializeClient):
3508         (WebKit::WebCookieManagerProxy::startObservingCookieChanges): Send the message down to the web process.
3509         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Ditto.
3510         (WebKit::WebCookieManagerProxy::cookiesDidChange): Tell the WKCookieManagerClient the cookies were
3511             modified.
3512         * UIProcess/WebCookieManagerProxy.h:
3513         * UIProcess/WebCookieManagerProxy.messages.in: Add new messages.
3514
3515         * UIProcess/WebCookieManagerProxyClient.cpp: Added.
3516         (WebKit::WebCookieManagerProxyClient::cookiesDidChange): Calls through to the client saying that
3517             cookies changed.
3518         * UIProcess/WebCookieManagerProxyClient.h: Added.
3519     
3520         * WebProcess/Cookies/WebCookieManager.cpp:
3521         (WebKit::WebCookieManager::startObservingCookieChanges): Call through to WebCore::startObservingCookieChanges
3522             (on platforms that support it).
3523         (WebKit::WebCookieManager::stopObservingCookieChanges): Ditto (for stopObservingCookieChanges).
3524         (WebKit::WebCookieManager::dispatchDidModifyCookies): Send a message to the UI process that cookies changed.
3525         * WebProcess/Cookies/WebCookieManager.h:
3526         * WebProcess/Cookies/WebCookieManager.messages.in:
3527         
3528         Add new files.
3529         * WebKit2.pro:
3530         * WebKit2.xcodeproj/project.pbxproj:
3531         * GNUmakefile.am:
3532         * win/WebKit2.vcproj:
3533
3534 2011-03-03  Anders Carlsson  <andersca@apple.com>
3535
3536         Reviewed by Darin Adler.
3537
3538         Remove CanRunBeforeUnloadConfirmPanel sync message
3539         https://bugs.webkit.org/show_bug.cgi?id=55689
3540
3541         * Shared/WebPageCreationParameters.cpp:
3542         (WebKit::WebPageCreationParameters::encode):
3543         (WebKit::WebPageCreationParameters::decode):
3544         Encode and decode canRunBeforeUnloadConfirmPanel, as well as canRunModal, which wasn't
3545         being encoded/decoded.
3546
3547         * Shared/WebPageCreationParameters.h:
3548         Add canRunBeforeUnloadConfirmPanel.
3549
3550         * UIProcess/WebPageProxy.cpp:
3551         (WebKit::WebPageProxy::initializeUIClient):
3552         Send SetCanRunBeforeUnloadConfirmPanel and SetCanRunModal messages.
3553
3554         (WebKit::WebPageProxy::creationParameters):
3555         Initialize parameters.canRunBeforeUnloadConfirmPanel.
3556
3557         * UIProcess/WebPageProxy.messages.in:
3558         Remove CanRunBeforeUnloadConfirmPanel message.
3559
3560         * UIProcess/WebUIClient.cpp:
3561         (WebKit::WebUIClient::canRunBeforeUnloadConfirmPanel):
3562         * UIProcess/WebUIClient.h:
3563         Make canRunBeforeUnloadConfirmPanel const.
3564
3565         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3566         (WebKit::WebChromeClient::canRunBeforeUnloadConfirmPanel):
3567         Ask the web page instead of sending a synchronous message.
3568
3569         * WebProcess/WebPage/WebPage.cpp:
3570         (WebKit::WebPage::WebPage):
3571         Initialize m_canRunBeforeUnloadConfirmPanel.
3572
3573         * WebProcess/WebPage/WebPage.h:
3574         (WebKit::WebPage::canRunBeforeUnloadConfirmPanel):
3575         (WebKit::WebPage::setCanRunBeforeUnloadConfirmPanel):
3576         Add getter and setter for m_canRunBeforeUnloadConfirmPanel.
3577
3578         (WebKit::WebPage::setCanRunModal):
3579         Add setter for m_canRunModal.
3580
3581         * WebProcess/WebPage/WebPage.messages.in:
3582         Add SetCanRunBeforeUnloadConfirmPanel and SetCanRunModal messages.
3583
3584 2011-03-03  Adam Roben  <aroben@apple.com>
3585
3586         Create the CFBundleRef for WebKit.dll on Windows if needed
3587
3588         WebKit part of <http://webkit.org/b/55672> <rdar://problem/9080867> All inspector tests time
3589         out or crash on Windows 7 Release (WebKit2 Tests)
3590
3591         Reviewed by Darin Adler.
3592
3593         * Shared/win/WebKitBundle.cpp: Added.
3594         (WebKit::createWebKitBundle): Returns a pre-existing bundle, if possible, otherwise creates
3595         and returns a new bundle.
3596         (WebKit::webKitBundle): Creates and caches a bundle, and returns it.
3597
3598         * Shared/win/WebKitBundle.h: Added.
3599
3600         * UIProcess/win/WebInspectorProxyWin.cpp:
3601         (WebKit::WebInspectorProxy::inspectorPageURL):
3602         * WebProcess/WebPage/win/WebInspectorWin.cpp:
3603         (WebKit::WebInspector::localizedStringsURL):
3604         Changed to use webKitBundle() to ensure that the bundle has been created.
3605
3606         * win/WebKit2.vcproj: Added new files.
3607
3608 2011-03-03  Peter Kasting  <pkasting@google.com>
3609
3610         Reviewed by James Robinson.
3611
3612         Drop redundant "Windows; " from the Windows-specific User Agent string.
3613         https://bugs.webkit.org/show_bug.cgi?id=54567
3614
3615         * UIProcess/win/WebPageProxyWin.cpp:
3616         (WebKit::WebPageProxy::standardUserAgent):
3617
3618 2011-03-02  Sheriff Bot  <webkit.review.bot@gmail.com>
3619
3620         Unreviewed, rolling out r80188.
3621         http://trac.webkit.org/changeset/80188
3622         https://bugs.webkit.org/show_bug.cgi?id=55647
3623
3624         Broke the WebKit API tests. (Requested by xenon on #webkit).
3625
3626         * UIProcess/API/C/WKPage.cpp:
3627         (WKPageRunJavaScriptInMainFrame):
3628         (callRunJavaScriptBlockAndRelease):
3629         * UIProcess/API/C/WKPage.h:
3630         * UIProcess/WebPageProxy.cpp:
3631         (WebKit::WebPageProxy::close):
3632         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
3633         (WebKit::WebPageProxy::processDidCrash):
3634         * UIProcess/WebPageProxy.h:
3635         * UIProcess/WebPageProxy.messages.in:
3636         * WebProcess/WebPage/WebPage.cpp:
3637         (WebKit::WebPage::runJavaScriptInMainFrame):
3638
3639 2011-03-02  Jeff Miller  <jeffm@apple.com>
3640
3641         Reviewed by Darin Adler.
3642
3643         Rename WebKit::WebPage::validateMenuItem() to validateCommand()
3644         https://bugs.webkit.org/show_bug.cgi?id=55636
3645         
3646         Since this method can validate more than menu items, validateCommand() is a better name.  Also rename various messages and WebKit::WebPageProxy::didValidateMenuItem() to didValidateCommand().
3647
3648         * UIProcess/API/mac/WKView.mm:
3649         (-[WKView validateUserInterfaceItem:]): Call validateCommand() instead of validateMenuItem().
3650         * UIProcess/WebPageProxy.cpp:
3651         (WebKit::WebPageProxy::validateCommand): Renamed from validateMenuItem().
3652         (WebKit::WebPageProxy::didValidateCommand): Renamed from didValidateMenuItem().
3653         * UIProcess/WebPageProxy.h:
3654         * UIProcess/WebPageProxy.messages.in: Renamed DidValidateMenuItem to DidValidateCommand.
3655         * WebProcess/WebPage/WebPage.cpp:
3656         (WebKit::WebPage::validateCommand): Renamed from validateMenuItem().
3657         * WebProcess/WebPage/WebPage.h:
3658         * WebProcess/WebPage/WebPage.messages.in: Renamed ValidateMenuItem to ValidateCommand.
3659
3660 2011-03-02  Anders Carlsson  <andersca@apple.com>
3661
3662         Reviewed by Sam Weinig.
3663
3664         WKPageSetMemoryCacheClientCallsEnabled doesn't persist if web process crashes
3665         https://bugs.webkit.org/show_bug.cgi?id=55635
3666
3667         * Shared/WebPageCreationParameters.cpp:
3668         (WebKit::WebPageCreationParameters::encode):
3669         (WebKit::WebPageCreationParameters::decode):
3670         Encode and decode areMemoryCacheClientCallsEnabled.
3671
3672         * Shared/WebPageCreationParameters.h:
3673         Add areMemoryCacheClientCallsEnabled member variable.
3674
3675         * UIProcess/WebPageProxy.cpp:
3676         (WebKit::WebPageProxy::WebPageProxy):
3677         Initialize m_areMemoryCacheClientCallsEnabled.
3678
3679         (WebKit::WebPageProxy::setMemoryCacheClientCallsEnabled):
3680         Update m_areMemoryCacheClientCallsEnabled. Send a message if necessary.
3681
3682         (WebKit::WebPageProxy::creationParameters):
3683         Set areMemoryCacheClientCallsEnabled.
3684
3685         * WebProcess/WebPage/WebPage.cpp:
3686         (WebKit::WebPage::WebPage):
3687         Call WebPage::setMemoryCacheMessagesEnabled.
3688
3689 2011-03-02  Timothy Hatcher  <timothy@apple.com>
3690
3691         Make the runJavaScriptInMainFrame callback send a WKSerializedScriptValueRef.
3692
3693         https://webkit.org/b/55623
3694
3695         Reviewed by Darin Adler.
3696
3697         * UIProcess/API/C/WKPage.cpp:
3698         (WKPageRunJavaScriptInMainFrame): Use ScriptValueCallback.
3699         (callRunJavaScriptBlockAndRelease): Use WKSerializedScriptValueRef.
3700         * UIProcess/API/C/WKPage.h: Use WKSerializedScriptValueRef.
3701         * UIProcess/WebPageProxy.cpp:
3702         (WebKit::WebPageProxy::close): Call invalidateCallbackMap for m_scriptValueCallbacks.
3703         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Take a ScriptValueCallback.
3704         (WebKit::WebPageProxy::scriptValueCallback): Added. Create a WebSerializedScriptValue
3705         from the DataReference before calling the callback.
3706         (WebKit::WebPageProxy::processDidCrash): Call invalidateCallbackMap for m_scriptValueCallbacks.
3707         * UIProcess/WebPageProxy.h: Added ScriptValueCallback and m_scriptValueCallbacks.
3708         * UIProcess/WebPageProxy.messages.in: Added ScriptValueCallback.
3709         * WebProcess/WebPage/WebPage.cpp:
3710         (WebKit::WebPage::runJavaScriptInMainFrame): Create a DataReference from a WebCore::SerializedScriptValue.
3711         And use ScriptValueCallback to send the message back.
3712
3713 2011-03-02  Jessie Berlin  <jberlin@apple.com>
3714
3715         Reviewed by Adam Roben.
3716
3717         WebKit2: Use CFNetwork Sessions API.
3718         https://bugs.webkit.org/show_bug.cgi?id=55435
3719
3720         Add the ability to create a Private Browsing Storage Session.
3721
3722         * Shared/WebProcessCreationParameters.cpp:
3723         (WebKit::WebProcessCreationParameters::encode):
3724         Encode the UI Process bundle identifier.
3725         (WebKit::WebProcessCreationParameters::decode):
3726         Decode the UI Process bundle identifier.
3727         * Shared/WebProcessCreationParameters.h:
3728
3729         * UIProcess/mac/WebContextMac.mm:
3730         (WebKit::WebContext::platformInitializeWebProcess):
3731         Grab the bundle identifier and use it to set the WebProcessCreationParameter.
3732         * UIProcess/win/WebContextWin.cpp:
3733         (WebKit::WebContext::platformInitializeWebProcess):
3734         Ditto.
3735
3736         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3737         (InitWebCoreSystemInterface):
3738         Support using the wkCreatePrivateStorageSession WKSI in WebCore.
3739
3740         * WebProcess/WebProcess.cpp:
3741         (WebKit::WebProcess::initializeWebProcess):
3742         Set the base for the Private Browsing Storage Session identifier to be the bundle identifier
3743         from the UI Process so that WebKit1 would create a Private Browsing Storage Session with the
3744         same identifier as WebKit2.
3745
3746 2011-03-01  Brian Weinstein  <bweinstein@apple.com>
3747
3748         Reviewed by Adam Roben.
3749
3750         Part of WebKit2: Need a way to send notifications to client when cookies change
3751         https://bugs.webkit.org/show_bug.cgi?id=55427
3752         <rdar://problem/9056027>
3753
3754         * WebProcess/Cookies/WebCookieManager.cpp:
3755         (WebKit::WebCookieManager::dispatchDidModifyCookies): Add a stub with a FIXME to send a 
3756             message to the UI process.
3757
3758         * WebProcess/Cookies/WebCookieManager.h:
3759         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3760         (WebKit::WebPlatformStrategies::createCookiesStrategy):
3761         (WebKit::WebPlatformStrategies::notifyCookiesChanged): Call WebCookieManager::dispatchDidModifyCookies.
3762         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3763
3764 2011-03-02  Andras Becsi  <abecsi@webkit.org>
3765
3766         Reviewed by Laszlo Gombos.
3767
3768         [Qt][WK2] generate-forwarding-headers.pl should generate paths with framework names
3769         https://bugs.webkit.org/show_bug.cgi?id=55478
3770
3771         On case insensitive systems the generated forwarding headers cause build problems.
3772
3773         * Scripts/generate-forwarding-headers.pl: The generated header should
3774         also contain the framework name.
3775
3776 2011-03-01  Jeff Miller  <jeffm@apple.com>
3777
3778         Reviewed by Darin Adler.
3779
3780         Expose some selection state fields in WKPage
3781         https://bugs.webkit.org/show_bug.cgi?id=55541
3782         
3783         Added WKPageCanDelete(), WKPageHasSelectedRange(), and WKPageIsContentEditable() so we can enable some
3784         Edit menu items properly on Windows when using WebKit2.
3785
3786         * UIProcess/API/C/WKPage.cpp:
3787         (WKPageCanDelete): Added.
3788         (WKPageHasSelectedRange): Added.
3789         (WKPageIsContentEditable): Added.
3790         * UIProcess/API/C/WKPage.h: Added new functions.
3791         * UIProcess/WebPageProxy.h:
3792         (WebKit::WebPageProxy::canDelete): Added.
3793         (WebKit::WebPageProxy::hasSelectedRange): Added.
3794         (WebKit::WebPageProxy::isContentEditable): Added.
3795
3796 2011-03-01  Mark Rowe  <mrowe@apple.com>
3797
3798         Hide the typeinfo name symbols for std::exception and std::bad_alloc too.
3799
3800         * Configurations/Base.xcconfig:
3801
3802 2011-03-01  Mark Rowe  <mrowe@apple.com>
3803
3804         Reviewed by Sam Weinig.
3805
3806         Add verification scripts to WebKit2 project and fix the issues they reveal.
3807
3808         * Configurations/Base.xcconfig: Add linker flags to prevent C++ standard
3809         library functions from being exported as weak externals.
3810         * Configurations/WebKit2.xcconfig: Inherit linker flags from the project level.
3811         * Shared/WebContextMenuItem.cpp:
3812         (WebKit::WebContextMenuItem::separatorItem): Use DEFINE_STATIC_LOCAL.
3813         * UIProcess/WebPageGroup.cpp:
3814         (WebKit::webPageGroupMap): Ditto.
3815         * WebKit2.xcodeproj/project.pbxproj: Don't copy .in files in to the framework.
3816         Run verification scripts at the appropriate times.
3817         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3818         (WebKit::WebEditorClient::didBeginEditing): Use DEFINE_STATIC_LOCAL.
3819         (WebKit::WebEditorClient::respondToChangedContents): Ditto.
3820         (WebKit::WebEditorClient::respondToChangedSelection): Ditto.
3821         (WebKit::WebEditorClient::didEndEditing): Ditto.
3822         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3823         (WebKit::idToHistoryItemMap): Ditto.
3824         (WebKit::historyItemToIDMap): Ditto.
3825
3826 2011-03-01  Joseph Pecoraro  <joepeck@webkit.org>
3827
3828         Unreviewed. Roll out r80068 and r80073 due to breaking WebKit2 Qt port.
3829
3830         * UIProcess/API/qt/qwkpage.cpp:
3831         (QWKPage::viewportAttributesForSize):
3832
3833 2011-03-01  Joseph Pecoraro  <joepeck@webkit.org>
3834
3835         Unreviewed, missed updating a call to WebCore::computeViewportAttributes
3836         who's prototype changed.
3837
3838         Viewport Warning/Error Messages Are Now Inaccurate
3839         https://bugs.webkit.org/show_bug.cgi?id=53707
3840
3841         * UIProcess/API/qt/qwkpage.cpp:
3842         (QWKPage::viewportAttributesForSize): pass in a value for the document argument.
3843
3844 2011-03-01  Anders Carlsson  <andersca@apple.com>
3845
3846         Reviewed by Sam Weinig.
3847
3848         WKPluginSiteDataManagerClearAllSiteData is not working
3849         https://bugs.webkit.org/show_bug.cgi?id=55528
3850         <rdar://problem/9071823>
3851
3852         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
3853         (WebKit::NetscapePluginModule::tryGetSitesWithData):
3854         Remove version checks, checking that the function pointer is not null is enough.
3855
3856         (WebKit::NetscapePluginModule::tryClearSiteData):
3857         Remove version checks, checking that the function pointer is not null is enough.
3858         Also, correctly convert a null String to a null CString.
3859
3860 2011-03-01  Adam Roben  <aroben@apple.com>
3861
3862         Incorporate a review comment I missed in r80051
3863
3864         * Shared/Plugins/Netscape/NetscapePluginModule.cpp: Clarified error message.
3865
3866 2011-03-01  Adam Roben  <aroben@apple.com>
3867
3868         Make the PLUGIN_ARCHITECTURE() macro work with MSVC
3869
3870         Fixes <http://webkit.org/b/55513> <rdar://problem/9069189> REGRESSION (r79925): Lots of
3871         plugins tests crashing in NetscapePlugin::initialize on Windows
3872
3873         Reviewed by Anders Carlsson.
3874
3875         * Shared/Plugins/Netscape/NetscapePluginModule.cpp: Added a compile-time check to make sure
3876         PLUGIN_ARCHITECTURE() is defined for some platform.
3877
3878         * config.h: Removed the parentheses from the use of "defined" in the PLUGIN_ARCHITECTURE()
3879         macro. This matches PLATFORM(), OS(), etc., and makes the macro work on Windows. Also
3880         replaced the nonsense OS(WIN) with OS(WINDOWS).
3881
3882         * win/WebKit2.vcproj: Added config.h for editing convenience. Let VS do its thang.
3883
3884 2011-03-01  Sam Weinig  <sam@webkit.org>
3885
3886         Reviewed by Timothy Hatcher.
3887
3888         WebKit2 needs to be made localizable
3889         https://bugs.webkit.org/show_bug.cgi?id=55483
3890
3891         * PluginProcess/mac/PluginProcessMainMac.mm:
3892         * WebProcess/mac/WebProcessMainMac.mm:
3893         Set the default localization from the passed in parameter.
3894
3895         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3896         Add the preferred localization as a parameter when launching processes
3897         so that they can set their localization to match the launching app.
3898
3899         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3900         Use WebCore's localizedString function on the mac, to actually localize
3901         these strings.
3902
3903         (WebKit::WebPlatformStrategies::imageTitle):
3904         Switch to using replace, instead of concatenation, to give localizers a chance
3905         to rearrange the wording.
3906
3907 2011-03-01  Balazs Kelemen  <kbalazs@webkit.org>
3908
3909         Reviewed by Anders Carlsson.
3910
3911         [Qt][WK2] Plugin initialization
3912         https://bugs.webkit.org/show_bug.cgi?id=48127
3913
3914         Apply the quirks that are necessary for the flash plugin
3915         to not crash on X11.
3916
3917         * Platform/qt/ModuleQt.cpp:
3918         (WebKit::Module::load): Use the ResolveAllSymbols hint as we do in WebCore.
3919         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
3920         (WebKit::NetscapePluginModule::tryLoad): Call applyX11QuirksBeforeLoad
3921         if PLUGIN_ARCHITECTURE is X11.
3922         * Shared/Plugins/Netscape/NetscapePluginModule.h:
3923         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
3924         (WebKit::initializeGTK):  The same hack that we do in WebCore.
3925         Call gtk_init because flash don't do it for itself.
3926         (WebKit::NetscapePluginModule::applyX11QuirksBeforeLoad): Added for X11.
3927         Do the hacks that we need to do before calling NP_Initialize on the
3928         flash plugin to save it form crashing.
3929         * Shared/Plugins/PluginQuirks.h: Use PLUGIN_ARCHITECTURE macros.
3930         Added RequiresGTKToolKit quirk for X11.
3931         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3932         (WebKit::NPN_GetValue): Handle the RequiresGTKToolKit quirk on X11.
3933         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3934         (WebKit::NetscapePlugin::quirks): Added getter for the PluginModule's
3935         quirks to be available in NPN_GetValue.
3936
3937 2011-03-01  Adam Roben  <aroben@apple.com>
3938
3939         Convert seconds to milliseconds before calling ::SetTimer
3940
3941         Fixes <http://webkit.org/b/55417> <rdar://problem/9065287> RunLoop::Timer fires 1000x too
3942         early on Windows
3943
3944         Reviewed by Anders Carlsson.
3945
3946         * Platform/win/RunLoopWin.cpp:
3947         (RunLoop::TimerBase::start): Convert the timeout interval to milliseconds, since that's what
3948         ::SetTimer expects.
3949
3950 2011-03-01  Andras Becsi  <abecsi@webkit.org>
3951
3952         Reviewed by Csaba Osztrogonác.
3953
3954         [Qt] Clean up the project files and move common options to WebKit.pri.
3955
3956         * WebKit2.pro: Deduplicate options.
3957
3958 2011-03-01  Juha Savolainen  <juha.savolainen@weego.fi>
3959
3960         Reviewed by Andreas Kling.
3961
3962         [Qt] WebKit2 needs to support font size changing and getting default font size
3963         https://bugs.webkit.org/show_bug.cgi?id=53671
3964
3965         Added new enum for font size type and added methods to set and get default font sizes.
3966
3967         * UIProcess/API/qt/qwkpreferences.cpp:
3968         (QWKPreferences::setFontSize): Added.
3969         (QWKPreferences::fontSize): Added.
3970         * UIProcess/API/qt/qwkpreferences.h:
3971
3972 2011-02-28  Alice Liu  <alice.liu@apple.com>
3973
3974         Reviewed by Adam Roben and Gavin Barraclough.
3975
3976         https://bugs.webkit.org/show_bug.cgi?id=54898
3977         InjectedBundleNodeHandle dies too early in WKBundleHitTestResultGetNodeHandle
3978
3979         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
3980         (WKBundleHitTestResultCopyNodeHandle): 
3981         Instead of .get(), call .release.leakRef() like other functions that return WKBundleNodeHandleRef.
3982         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
3983         Renamed from "get" to "copy", because it leaksRef.
3984
3985 2011-02-28  Alice Liu  <alice.liu@apple.com>
3986
3987         Reviewed by Gavin Barraclough.
3988
3989         https://bugs.webkit.org/show_bug.cgi?id=55442
3990         Webarchives don't contain subframe content
3991
3992         * WebProcess/WebPage/WebPage.cpp:
3993         (WebKit::WebPage::getWebArchiveOfFrame):
3994         Pass the frame's document instead of just the frame, to use a different LegacyWebArchive::create function.
3995
3996 2011-02-28  Benjamin Poulain  <benjamin.poulain@nokia.com>
3997
3998         Reviewed by Kenneth Rohde Christiansen.
3999
4000         [Qt][WK2] Add a way to test the WebKit 2 APIs
4001         https://bugs.webkit.org/show_bug.cgi?id=55408
4002
4003         Add an initial test for the WebKit 2 APIs of Qt.
4004
4005         * UIProcess/API/qt/tests/html/basic_page.html: Added.
4006         * UIProcess/API/qt/tests/qgraphicswkview/qgraphicswkview.pro: Added.
4007         * UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp: Added.
4008         (View::View):
4009         (View::resizeEvent):
4010         (tst_QGraphicsWKView::init):
4011         (tst_QGraphicsWKView::cleanup):
4012         (tst_QGraphicsWKView::loadEmptyPage):
4013         * UIProcess/API/qt/tests/tests.pri: Added.
4014         * UIProcess/API/qt/tests/tests.pro: Added.
4015         * UIProcess/API/qt/tests/util.h: Added.
4016         (waitForSignal):
4017
4018 2011-02-28  Anders Carlsson  <andersca@apple.com>
4019
4020         Fix clang build.
4021
4022         * UIProcess/API/mac/FindIndicatorWindow.mm:
4023         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
4024         (WebKit::ChunkedUpdateDrawingAreaProxy::deprecatedUpdate):
4025         (WebKit::ChunkedUpdateDrawingAreaProxy::didReceiveMessage):
4026         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
4027         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
4028         (WebKit::ChunkedUpdateDrawingArea::deprecatedResumePainting):
4029         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
4030         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
4031
4032 2011-02-28  Dan Bernstein  <mitz@apple.com>
4033
4034         Rubber-stamped by Anders Carlsson.
4035
4036         Do not copy config.h into WebKit2.
4037
4038         * WebKit2.xcodeproj/project.pbxproj:
4039
4040 2011-02-28  Dan Bernstein  <mitz@apple.com>
4041
4042         LLVM Compiler build fix.
4043
4044         * Scripts/webkit2/messages.py:
4045         * UIProcess/WebPageProxy.h:
4046
4047 2011-02-28  Anders Carlsson  <andersca@apple.com>
4048
4049         Reviewed by Dan Bernstein, Sam Weinig, Alexey Proskuryakov and Darin Adler.
4050
4051         Open PDF in Preview doesn't work
4052         https://bugs.webkit.org/show_bug.cgi?id=55400
4053         <rdar://problem/8750353>
4054
4055         * UIProcess/API/mac/PDFViewController.mm:
4056         (-[WKPDFView initWithFrame:PDFViewController:]):
4057         Set the WKPDFView as the delegate of itself.
4058
4059         (-[WKPDFView PDFViewOpenPDFInNativeApplication:]):
4060         Call PDFViewController::openPDFInFinder.
4061
4062         (WebKit::PDFViewController::PDFViewController):
4063         Initialize m_hasWrittenPDFToDisk to false.
4064
4065         (WebKit::PDFViewController::openPDFInFinder):
4066         Write the PDF to disk if needed and then open it using -[NSWorkspace openFile:].
4067         
4068         (WebKit::temporaryPDFDirectoryPath):
4069         Create a directory to put PDFs in.
4070
4071         (WebKit::PDFViewController::pathToPDFOnDisk):
4072         Return a path to a (non-existent) file in the temporary PDF directory.
4073
4074 2011-02-28  Alexey Proskuryakov  <ap@apple.com>
4075
4076         Reviewed by Dan Bernstein.
4077
4078         Frequent crashes in CFURLCache code on Snow Leopard
4079         https://bugs.webkit.org/show_bug.cgi?id=55412
4080         <rdar://problem/9063922>
4081
4082         CString is evil, it has two lengths which can be different - specifically, fileSystemRepresentation()
4083         creates a string with maximum possible buffer size. A path with garbage at the end confused
4084         CFURLCache into corrupting its data structures.
4085
4086         * Shared/WebProcessCreationParameters.h: Added a FIXME about merging Mac and Windows code.
4087         This problem wouldn't have occured if we didn't use CString in the first place.
4088
4089         * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformInitializeWebProcess):
4090         Added an assertion matching Windows behavior (seems likely that NSURLCache also wouldn't
4091         have liked trailing slash).
4092
4093         * UIProcess/win/WebContextWin.cpp: (WebKit::WebContext::platformInitializeWebProcess):
4094         Made slash removal conditional for robustness.
4095
4096         * WebProcess/mac/WebProcessMac.mm: (WebKit::WebProcess::platformInitializeWebProcess):
4097         Use actual string length, not CString::length().
4098
4099 2011-02-28  Balazs Kelemen  <kbalazs@webkit.org>
4100
4101         Reviewed by Anders Carlsson.
4102
4103         [Qt][WK2] Plugin initialization
4104         https://bugs.webkit.org/show_bug.cgi?id=48127
4105
4106         Specialize the way of initializing the plugin for X11.
4107         Introduce PLUGIN_ARCHITECTURE macros to allow code sharing
4108