Ensure that the correct initial focusable area is focused when tabbing
[WebKit-https.git] / WebKit2 / ChangeLog
1 2011-01-03  Sam Weinig  <sam@webkit.org>
2
3         Reviewed by Anders Carlsson.
4
5         Ensure that the correct initial focusable area is focused when tabbing
6         and shift-tabbing into the WKView.
7
8         * UIProcess/API/mac/WKView.mm:
9         (-[WKView becomeFirstResponder]): Use the keyViewSelectionDirection to set
10         the initial focus.
11
12 2011-01-02  Dan Bernstein  <mitz@apple.com>
13
14         Rubber-stamped by Simon Fraser.
15
16         <rdar://problem/8812159> Update copyright strings
17
18         * Info.plist:
19         * WebProcess/Info.plist:
20
21 2011-01-02  Benjamin Poulain  <benjamin.poulain@nokia.com>
22
23         Reviewed by Csaba Osztrogonác.
24
25         WebKit 2 does not build on 64bits with a recent GCC
26         https://bugs.webkit.org/show_bug.cgi?id=51754
27
28         Change the argument coding for DatabaseDetails to use explicitly the 64 bits type.
29
30         * Shared/OriginAndDatabases.h:
31         * Shared/WebCoreArgumentCoders.h:
32
33 2011-01-02  Csaba Osztrogonác  <ossy@webkit.org>
34
35         Reviewed by Adam Barth.
36
37         Move JavaScriptCore to Source
38         https://bugs.webkit.org/show_bug.cgi?id=51604
39
40         Workaround until moving all sources to Source directory is finished.
41
42         * Scripts/generate-forwarding-headers.pl: Add Sources to searching path for JavaScriptCore.
43
44 2011-01-01  Adam Barth  <abarth@webkit.org>
45
46         Speculative build fix for Qt.  Add some more include paths.
47
48         * WebKit2.pro:
49
50 2011-01-01  Adam Barth  <abarth@webkit.org>
51
52         Reviewed by Eric Seidel.
53
54         Move JavaScriptCore to Source
55         https://bugs.webkit.org/show_bug.cgi?id=51604
56
57         * WebKit2.pro:
58           - Point to JavaScriptCore in its new location.
59
60 2010-12-15  Amruth Raj  <amruthraj@motorola.com> and Ravi Kasibhatla  <ravi.kasibhatla@motorola.com>
61
62         Reviewed by Martin Robinson.
63
64         [GTK] Enable building whatever already exists of WebKit2
65         https://bugs.webkit.org/show_bug.cgi?id=37369
66
67         * GNUmakefile.am: Added. 
68         * WebKit2Prefix.h: Included WebCore/config.h for GTK port as the first header
69         file for WebKit2 sources files.
70         * gtk: Added.
71         * gtk/webkit2.pc.in: Added.
72
73 2010-12-29  Juha Savolainen  <juha.savolainen@weego.fi>
74
75         Reviewed by Kenneth Rohde Christiansen.
76
77         [Qt] [WK2] Added more webattributes to the qwkpreferences
78         https://bugs.webkit.org/show_bug.cgi?id=51697
79
80         Added PrivateBrowsingEnabled, DeveloperExtrasEnabled, DnsPrefetchEnabled attributes
81
82         * UIProcess/API/qt/qwkpreferences.cpp:
83         (QWKPreferences::testAttribute): 
84         (QWKPreferences::setAttribute): 
85         * UIProcess/API/qt/qwkpreferences.h:
86
87 2010-12-27  Sam Weinig  <sam@webkit.org>
88
89         Reviewed by Anders Carlsson.
90
91         WebKit2 snapshots should contain accelerated content
92         <rdar://problem/8807393>
93         https://bugs.webkit.org/show_bug.cgi?id=51660
94
95         When creating a snapshot, flatten the layer tree for painting so that
96         accelerated content is included in the snapshot.
97
98         * WebProcess/WebPage/WebPage.cpp:
99         (WebKit::WebPage::snapshotInViewCoordinates):
100         (WebKit::WebPage::snapshotInDocumentCoordinates):
101
102 2010-12-27  Daniel Bates  <dbates@rim.com>
103
104         Attempt to fix the WebKit2 Windows build after changeset 74698
105         <http://trac.webkit.org/changeset/74698> (bug #51656).
106
107         Add "..\Shared\API\c\WKImage.h" to WebKit2Generated.make.
108
109         * win/WebKit2Generated.make:
110
111 2010-12-27  Sam Weinig  <sam@webkit.org>
112
113         Reviewed by Anders Carlsson.
114
115         WebKit2: Add API for getting snapshots
116         https://bugs.webkit.org/show_bug.cgi?id=51656
117
118         * Shared/API/c/WKBase.h:
119         * Shared/API/c/WKImage.cpp: Added.
120         (WKImageGetTypeID):
121         (WKImageCreate):
122         (WKImageGetSize):
123         * Shared/API/c/WKImage.h: Added.
124         * Shared/WebImage.cpp: Added.
125         (WebKit::WebImage::create):
126         (WebKit::WebImage::size):
127         * Shared/WebImage.h: Added.
128         (WebKit::WebImage::backingStore):
129         (WebKit::WebImage::WebImage):
130         (WebKit::WebImage::type):
131         Add a general purpose API image class.
132
133         * Shared/API/c/cg: Added.
134         * Shared/API/c/cg/WKImageCG.cpp: Added.
135         (WKImageCreateCGImage):
136         * Shared/API/c/cg/WKImageCG.h: Added.
137         Add function to convert a WKImageRef to a CGImageRef for platforms that use CG.
138
139         * Shared/API/c/WKSharedAPICast.h:
140         (WebKit::toFloatRect):
141         (WebKit::toIntSize):
142         (WebKit::toIntPoint):
143         (WebKit::toIntRect):
144         (WebKit::toImageOptions):
145         Make conversion functions that are ambiguous more explicit.
146
147         * Shared/APIObject.h:
148         * Shared/BackingStore.h:
149         (WebKit::BackingStore::isBackedBySharedMemory):
150         * Shared/ImageOptions.h: Added.
151         * Shared/UserMessageCoders.h:
152         (WebKit::UserMessageEncoder::baseEncode):
153         (WebKit::UserMessageDecoder::baseDecode):
154         Allow a WKImageRef to be passed in user messages.  Right now, it only
155         works if the image is sharable.
156
157         * UIProcess/API/C/WKPage.cpp:
158         (WKPageScaleWebView):
159         * UIProcess/WebUIClient.cpp:
160         (WebKit::WebUIClient::windowFrame):
161         Use the more explicit conversion function name.
162
163         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
164         (WKBundlePageCreateSnapshotInViewCoordinates):
165         (WKBundlePageCreateSnapshotInDocumentCoordinates):
166         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
167         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
168         (WKBundlePageOverlaySetNeedsDisplay):
169         * WebProcess/WebPage/WebPage.cpp:
170         (WebKit::WebPage::snapshotInViewCoordinates):
171         (WebKit::WebPage::snapshotInDocumentCoordinates):
172         Add function to take the snapshot.
173
174         * WebProcess/WebPage/WebPage.h:
175         * WebKit2.pro:
176         * WebKit2.xcodeproj/project.pbxproj:
177         * win/WebKit2.vcproj:
178         Add new files.
179
180 2010-12-27  Sam Weinig  <sam@webkit.org>
181
182         Reviewed by Anders Carlsson.
183
184         WebKit2: Add additional API for managing databases
185         https://bugs.webkit.org/show_bug.cgi?id=51629
186
187         - Adds client for the database manager to get notifications
188           of changes to databases.
189
190         * UIProcess/API/C/WKDatabaseManager.cpp:
191         (WKDatabaseManagerSetClient):
192         * UIProcess/API/C/WKDatabaseManager.h:
193         * UIProcess/WebDatabaseManagerProxy.cpp:
194         (WebKit::WebDatabaseManagerProxy::initializeClient):
195         (WebKit::WebDatabaseManagerProxy::didModifyOrigin):
196         (WebKit::WebDatabaseManagerProxy::didModifyDatabase):
197         * UIProcess/WebDatabaseManagerProxy.h:
198         * UIProcess/WebDatabaseManagerProxy.messages.in:
199         * UIProcess/WebDatabaseManagerProxyClient.cpp: Added.
200         (WebKit::WebDatabaseManagerProxyClient::didModifyOrigin):
201         (WebKit::WebDatabaseManagerProxyClient::didModifyDatabase):
202         * UIProcess/WebDatabaseManagerProxyClient.h: Added.
203         * WebKit2.pro:
204         * WebKit2.xcodeproj/project.pbxproj:
205         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
206         (WebKit::WebDatabaseManager::WebDatabaseManager):
207         (WebKit::WebDatabaseManager::~WebDatabaseManager):
208         (WebKit::WebDatabaseManager::dispatchDidModifyOrigin):
209         (WebKit::WebDatabaseManager::dispatchDidModifyDatabase):
210         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
211         * win/WebKit2.vcproj:
212
213 2010-12-27  Sam Weinig  <sam@webkit.org>
214
215         Reviewed by Anders Carlsson.
216
217         WebKit2: Add additional API for managing databases
218         https://bugs.webkit.org/show_bug.cgi?id=51629
219
220         - Adds WKDatabaseManagerGetDatabasesByOrigin, which asynchronously returns
221           an array of dictionaries containing details about each origin using 
222           databases and details about each database. Keys were added for accessing
223           the data in the dictionaries.
224         - Adds WKDatabaseManagerDeleteDatabasesWithNameForOrigin to delete a database
225           with a specific identifier.
226         - Adds WKDatabaseManagerSetQuotaForOrigin to set the quota for an origin.
227
228         * Shared/OriginAndDatabases.cpp: Added.
229         (WebKit::OriginAndDatabases::encode):
230         (WebKit::OriginAndDatabases::decode):
231         * Shared/OriginAndDatabases.h: Added.
232         * Shared/WebCoreArgumentCoders.h:
233         * UIProcess/API/C/WKDatabaseManager.cpp:
234         (WKDatabaseManagerGetOriginKey):
235         (WKDatabaseManagerGetOriginQuotaKey):
236         (WKDatabaseManagerGetOriginUsageKey):
237         (WKDatabaseManagerGetDatabaseDetailsKey):
238         (WKDatabaseManagerGetDatabaseDetailsNameKey):
239         (WKDatabaseManagerGetDatabaseDetailsDisplayNameKey):
240         (WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey):
241         (WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey):
242         (WKDatabaseManagerGetDatabasesByOrigin):
243         (callGetDatabasesByOriginBlockAndDispose):
244         (WKDatabaseManagerGetDatabasesByOrigin_b):
245         (WKDatabaseManagerGetDatabaseOrigins):
246         (callGetDatabaseOriginsBlockBlockAndDispose):
247         (WKDatabaseManagerGetDatabaseOrigins_b):
248         (WKDatabaseManagerDeleteDatabasesWithNameForOrigin):
249         (WKDatabaseManagerDeleteDatabasesForOrigin):
250         (WKDatabaseManagerDeleteAllDatabases):
251         (WKDatabaseManagerSetQuotaForOrigin):
252         * UIProcess/API/C/WKDatabaseManager.h:
253         * UIProcess/WebDatabaseManagerProxy.cpp:
254         (WebKit::WebDatabaseManagerProxy::originKey):
255         (WebKit::WebDatabaseManagerProxy::originQuotaKey):
256         (WebKit::WebDatabaseManagerProxy::originUsageKey):
257         (WebKit::WebDatabaseManagerProxy::databaseDetailsKey):
258         (WebKit::WebDatabaseManagerProxy::databaseDetailsNameKey):
259         (WebKit::WebDatabaseManagerProxy::databaseDetailsDisplayNameKey):
260         (WebKit::WebDatabaseManagerProxy::databaseDetailsExpectedUsageKey):
261         (WebKit::WebDatabaseManagerProxy::databaseDetailsCurrentUsageKey):
262         (WebKit::WebDatabaseManagerProxy::invalidate):
263         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
264         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
265         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
266         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
267         (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
268         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
269         (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
270         * UIProcess/WebDatabaseManagerProxy.h:
271         * UIProcess/WebDatabaseManagerProxy.messages.in:
272         * WebKit2.pro:
273         * WebKit2.xcodeproj/project.pbxproj:
274         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
275         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
276         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
277         (WebKit::WebDatabaseManager::setQuotaForOrigin):
278         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
279         * WebProcess/WebCoreSupport/WebDatabaseManager.messages.in:
280         * win/WebKit2.vcproj:
281
282 2010-12-26  Anders Carlsson  <andersca@apple.com>
283
284         Reviewed by Dan Bernstein.
285
286         Rename DrawingAreaMessage and DrawingAreaLegacyMessage and
287         DrawingAreaProxyMessage to DrawingAreaProxyLegacyMessage.
288
289         * Platform/CoreIPC/MessageID.h:
290         * Shared/CoreIPCSupport/DrawingAreaMessageKinds.h:
291         * Shared/CoreIPCSupport/DrawingAreaProxyMessageKinds.h:
292         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
293         (WebKit::ChunkedUpdateDrawingAreaProxy::paint):
294         (WebKit::ChunkedUpdateDrawingAreaProxy::setPageIsVisible):
295         (WebKit::ChunkedUpdateDrawingAreaProxy::update):
296         (WebKit::ChunkedUpdateDrawingAreaProxy::sendSetSize):
297         (WebKit::ChunkedUpdateDrawingAreaProxy::didReceiveMessage):
298         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
299         (WebKit::LayerBackedDrawingAreaProxy::sizeDidChange):
300         (WebKit::LayerBackedDrawingAreaProxy::setPageIsVisible):
301         (WebKit::LayerBackedDrawingAreaProxy::update):
302         (WebKit::LayerBackedDrawingAreaProxy::didReceiveMessage):
303         (WebKit::LayerBackedDrawingAreaProxy::didReceiveSyncMessage):
304         * UIProcess/TiledDrawingAreaProxy.cpp:
305         (WebKit::TiledDrawingAreaProxy::sizeDidChange):
306         (WebKit::TiledDrawingAreaProxy::setPageIsVisible):
307         (WebKit::TiledDrawingAreaProxy::didReceiveMessage):
308         (WebKit::TiledDrawingAreaProxy::requestTileUpdate):
309         (WebKit::TiledDrawingAreaProxy::waitUntilUpdatesComplete):
310         (WebKit::TiledDrawingAreaProxy::takeSnapshot):
311         (WebKit::TiledDrawingAreaProxy::removeTile):
312         * UIProcess/WebPageProxy.cpp:
313         (WebKit::WebPageProxy::didReceiveMessage):
314         (WebKit::WebPageProxy::didReceiveSyncMessage):
315         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
316         (WebKit::ChunkedUpdateDrawingArea::display):
317         (WebKit::ChunkedUpdateDrawingArea::setSize):
318         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
319         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
320         (WebKit::LayerBackedDrawingArea::setSize):
321         (WebKit::LayerBackedDrawingArea::didReceiveMessage):
322         * WebProcess/WebPage/TiledDrawingArea.cpp:
323         (WebKit::TiledDrawingArea::display):
324         (WebKit::TiledDrawingArea::setSize):
325         (WebKit::TiledDrawingArea::updateTile):
326         (WebKit::TiledDrawingArea::tileUpdateTimerFired):
327         (WebKit::TiledDrawingArea::didReceiveMessage):
328         * WebProcess/WebPage/WebPage.cpp:
329         (WebKit::WebPage::didReceiveMessage):
330         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
331         (WebKit::LayerBackedDrawingArea::attachCompositingContext):
332
333 2010-12-26  Anders Carlsson  <andersca@apple.com>
334
335         Reviewed by Sam Weinig.
336
337         Drawing area cleanup. Remove a bunch of redundant functions that just ended
338         up calling setNeedsDisplay.
339
340         * UIProcess/DrawingAreaProxy.h:
341         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
342         (WebKit::WebChromeClient::invalidateWindow):
343         (WebKit::WebChromeClient::invalidateContentsAndWindow):
344         (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
345         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
346         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
347         * WebProcess/WebPage/DrawingArea.h:
348         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
349         * WebProcess/WebPage/LayerBackedDrawingArea.h:
350         * WebProcess/WebPage/TiledDrawingArea.cpp:
351         * WebProcess/WebPage/TiledDrawingArea.h:
352
353 2010-12-25  Sam Weinig  <sam@webkit.org>
354
355         Reviewed by Dan Bernstein.
356
357         Fill in some more preferences for WebKit2
358         https://bugs.webkit.org/show_bug.cgi?id=51610
359
360         * Shared/WebPreferencesStore.h:
361         * UIProcess/API/C/WKPreferences.cpp:
362         (WKPreferencesSetAuthorAndUserStylesEnabled):
363         (WKPreferencesGetAuthorAndUserStylesEnabled):
364         (WKPreferencesSetWebArchiveDebugModeEnabled):
365         (WKPreferencesGetWebArchiveDebugModeEnabled):
366         (WKPreferencesSetLocalFileContentSniffingEnabled):
367         (WKPreferencesGetLocalFileContentSniffingEnabled):
368         (WKPreferencesSetPageCacheEnabled):
369         (WKPreferencesGetPageCacheEnabled):
370         (WKPreferencesSetPaginateDuringLayoutEnabled):
371         (WKPreferencesGetPaginateDuringLayoutEnabled):
372         (WKPreferencesSetDOMPasteAllowedEnabled):
373         (WKPreferencesGetDOMPasteAllowedEnabled):
374         * UIProcess/API/C/WKPreferences.h:
375         * UIProcess/API/C/WKPreferencesPrivate.h:
376         * WebProcess/WebPage/WebPage.cpp:
377         (WebKit::WebPage::updatePreferences):
378         Pipe through some more preferences.
379
380 2010-12-24  Dan Bernstein  <mitz@apple.com>
381
382         Reviewed by Alexey Proskuryakov.
383
384         REGRESSION (r74648): XHR layout test failures
385         https://bugs.webkit.org/show_bug.cgi?id=51603
386
387         Reverted r74648.
388
389         * UIProcess/WebPageProxy.cpp:
390         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge):
391         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
392         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage):
393         * WebProcess/mac/WebProcessMainMac.mm:
394         (WebKit::WebProcessMain):
395
396 2010-12-24  Simon Fraser  <simon.fraser@apple.com>
397
398         Fix the Qt build after r74650.
399
400         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
401
402 2010-12-24  Benjamin Poulain  <ikipou@gmail.com>
403
404         Reviewed by Darin Adler.
405
406         [Qt] [WK2] WebKit 2 does not build on mac, missing reference to RetainPtr
407         https://bugs.webkit.org/show_bug.cgi?id=51598
408
409         Fix the build, add the missing header.
410
411         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
412
413 2010-12-24  Dan Bernstein  <mitz@apple.com>
414
415         Reviewed by Anders Carlsson.
416
417         <rdar://problem/8758386> The web process uses its own credential storage
418         https://bugs.webkit.org/show_bug.cgi?id=51599
419
420         * UIProcess/WebPageProxy.cpp:
421         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): Try to answer the challenge using
422         the UI process’s credential storage first.
423         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
424         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage): Prevent the web process from using
425         its own credential storage.
426         * WebProcess/mac/WebProcessMainMac.mm:
427         (WebKit::WebProcessMain): Ditto.
428
429 2010-12-23  Dan Bernstein  <mitz@apple.com>
430
431         Reviewed by Sam Weinig.
432
433         Make dragging work again after r74591.
434
435         * UIProcess/WebPageProxy.cpp:
436         (WebKit::WebPageProxy::didReceiveEvent): Fixed a typo.
437
438 2010-12-23  Jessie Berlin  <jberlin@apple.com>
439
440         Reviewed by Sam Weinig.
441
442         Need WebKit2 API to create a SecurityOrigin from protocol, host, and port
443         https://bugs.webkit.org/show_bug.cgi?id=51563
444
445         Add WKSecurityOriginCreate(WKStringRef protocol, WKStringRef host, int port).
446
447         * Shared/API/c/WKSecurityOrigin.cpp:
448         (WKSecurityOriginCreateFromIdentifier):
449         Renamed so as not to clash with the new WKSecurityOriginCreate.
450         (WKSecurityOriginCreate):
451         * Shared/API/c/WKSecurityOrigin.h:
452         * Shared/WebSecurityOrigin.h:
453         (WebKit::WebSecurityOrigin::create):
454
455 2010-12-23  Anders Carlsson  <andersca@apple.com>
456
457         Reviewed by Simon Fraser.
458
459         Ensure that we are not getting too many mouse move events
460         https://bugs.webkit.org/show_bug.cgi?id=51568
461         <rdar://problem/7881470>
462         <rdar://problem/8735512>
463
464         Implement throttling of mouse move events.
465
466         * UIProcess/WebPageProxy.cpp:
467         (WebKit::WebPageProxy::WebPageProxy):
468         Initialize m_processingMouseMoveEvent to false.
469
470         (WebKit::WebPageProxy::handleMouseEvent):
471         If we're already processing a mouse move events, just update 
472         m_nextMouseMoveEvent and return.
473  
474         (WebKit::WebPageProxy::didReceiveEvent):
475         If we received a mouse move event, send the next mouse move event if there is one.
476
477 2010-12-23  Brian Weinstein  <bweinstein@apple.com>
478
479         Reviewed by Anders Carlsson.
480
481         Assertion when loading www.yahoo.com in WebKit2 under decodeResourceRequest
482         https://bugs.webkit.org/show_bug.cgi?id=51562
483         
484         Don't assert that our data reference isn't empty when we try to get the data from it.
485         If it is empty, just return 0.
486         
487         All callers are safe with this function returning 0.
488
489         * Platform/CoreIPC/DataReference.h:
490         (CoreIPC::DataReference::data): Change the assert to an early return.
491         * Shared/cf/ArgumentCodersCF.cpp:
492         (CoreIPC::decode): Add an assert, and remove a ternarny operator because the function now does
493             this for us (if the data is empty, return 0).
494
495 2010-12-23  Sam Weinig  <sam@webkit.org>
496
497         Fix incorrect assertion causing all pages with subframes to crash.
498
499         * UIProcess/WebFrameProxy.cpp:
500         (WebKit::WebFrameProxy::appendChild):
501
502 2010-12-23  Anders Carlsson  <andersca@apple.com>
503
504         Reviewed by Darin Adler.
505
506         Clean up the selection handling code
507         https://bugs.webkit.org/show_bug.cgi?id=51550
508
509         * Shared/SelectionState.h: Added.
510         Add SelectionState class which hold information about the current selection.
511
512         * UIProcess/API/mac/PageClientImpl.h:
513         * UIProcess/API/mac/PageClientImpl.mm:
514         Remove selectionChanged function.
515
516         * UIProcess/API/mac/WKView.mm:
517         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
518         Remove all the selection related state; it lives in the WebPageProxy object now.
519         
520         (-[WKView insertText:]):
521         (-[WKView selectedRange]):
522         (-[WKView hasMarkedText]):
523         Get the selection information from the WebPageProxy.
524
525         * UIProcess/API/mac/WKViewInternal.h:
526         Remove _selectionChanged declaration.
527
528         * UIProcess/PageClient.h:
529         Remove selectionChanged functions.
530
531         * UIProcess/WebPageProxy.cpp:
532         (WebKit::WebPageProxy::selectionStateChanged):
533         Update the selection state.
534
535         * UIProcess/WebPageProxy.h:
536         (WebKit::WebPageProxy::selectionState):
537         Return the selection state.
538
539         * UIProcess/WebPageProxy.messages.in:
540         Add SelectionStateChanged message.
541
542         * UIProcess/win/WebView.cpp:
543         (WebKit::WebView::WebView):
544         Remove all the selection related state; it lives in the WebPageProxy object now.
545
546         (WebKit::WebView::compositionSelectionChanged):
547         (WebKit::WebView::onIMEComposition):
548         (WebKit::WebView::onIMEEndComposition):
549         (WebKit::WebView::onIMERequestCharPosition):
550         (WebKit::WebView::onIMERequest):
551         Get the selection information from the WebPageProxy.
552         
553         * WebKit2.xcodeproj/project.pbxproj:
554         Add SelectionState.h
555
556         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
557         (WebKit::WebEditorClient::respondToChangedSelection):
558         Send a SelectionStateChanged message with the updated state.
559
560         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
561         Remove mac specific code.
562
563         * WebProcess/WebPage/WebPage.cpp:
564         (WebKit::WebPage::getLocationAndLengthFromRange):
565         Rename this function from convertRangeToPlatformRange and move it out of WebPageMac.mm
566
567         * WebProcess/WebPage/mac/WebPageMac.mm:
568         (WebKit::WebPage::getMarkedRange):
569         (WebKit::WebPage::characterIndexForPoint):
570         Call getLocationAndLengthFromRange.
571
572         * win/WebKit2.vcproj:
573         Add SelectionState.h
574
575 2010-12-23  Darin Adler  <darin@apple.com>
576
577         Reviewed by Sam Weinig.
578
579         WKView should not try to do asynchronous validation for selectors that are not editor commands
580         https://bugs.webkit.org/show_bug.cgi?id=51555
581
582         * UIProcess/API/mac/WKView.mm:
583         (-[WKView validateUserInterfaceItem:]): Removed the special case for startSpeaking.
584         Added call to commandIsSupportedFromMenuOrKeyBinding so we only try to do validation
585         for commands that are supported. Tweaked comments and added some bug numbers.
586         (-[WKView _setUserInterfaceItemState:enabled:state:]): Tweaked comment and added
587         bug number.
588
589 2010-12-23  Sam Weinig  <sam@webkit.org>
590
591         Reviewed by Anders Carlsson.
592
593         <rdar://problem/8799032>
594         REGRESSION(r74436) Crash opening many pages with WebKit2
595
596         * Shared/cf/ArgumentCodersCF.cpp:
597         (CoreIPC::decode):
598         Fix paste-o. Decode into a CFDataRef not a CFDictionaryRef
599         when decoding CFDataRefs.
600
601 2010-12-22  Sam Weinig  <sam@webkit.org>
602
603         Reviewed by Darin Adler.
604
605         WebKit2 needs to mirror the frame tree in the UIProcess
606         https://bugs.webkit.org/show_bug.cgi?id=51546
607
608         * UIProcess/API/C/WKFrame.cpp:
609         (WKFrameCopyChildFrames):
610         * UIProcess/API/C/WKFrame.h:
611         Add API to get the child frames of a frame.
612
613         * UIProcess/WebFrameProxy.cpp:
614         (WebKit::WebFrameProxy::WebFrameProxy):
615         (WebKit::WebFrameProxy::disconnect):
616         (WebKit::WebFrameProxy::appendChild):
617         (WebKit::WebFrameProxy::removeChild):
618         (WebKit::WebFrameProxy::isDescendantOf):
619         (WebKit::WebFrameProxy::dumpFrameTree):
620         (WebKit::WebFrameProxy::didRemoveFromHierarchy):
621         (WebKit::WebFrameProxy::childFrames):
622         * UIProcess/WebFrameProxy.h:
623         (WebKit::WebFrameProxy::parentFrame): Add getter.
624         (WebKit::WebFrameProxy::nextSibling): Add getter.
625         (WebKit::WebFrameProxy::previousSibling): Add getter.
626         (WebKit::WebFrameProxy::firstChild): Add getter.
627         (WebKit::WebFrameProxy::lastChild): Add getter.
628         Make frames keep track of their subframes.
629
630         * UIProcess/WebPageProxy.cpp:
631         (WebKit::WebPageProxy::didCreateSubframe):
632         Use the now passed parentID to insert the frame into the hierarchy
633
634         (WebKit::WebPageProxy::didSaveFrameToPageCache):
635         When a frame is added to the page cache, remove it from the hierarchy.
636
637         (WebKit::WebPageProxy::didRestoreFrameFromPageCache):
638         When a frame is restored from the page cache, add it back to the hierarchy.
639
640         (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
641         Detached frames should also be removed from the hierarchy.
642
643         * UIProcess/WebPageProxy.h:
644         Add new declarations for didSaveFrameToPageCache and didRestoreFrameFromPageCache.
645
646         * UIProcess/WebPageProxy.messages.in:
647         Add messages for DidSaveFrameToPageCache and DidRestoreFrameFromPageCache.
648
649         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
650         (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame): 
651         (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
652         Remove notImplemented, there is no work we need to do here.
653
654         (WebKit::WebFrameLoaderClient::didSaveToPageCache): 
655         (WebKit::WebFrameLoaderClient::didRestoreFromPageCache):
656         Send message to UIProcess to indicate this happened.
657         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
658
659         * WebProcess/WebPage/WebFrame.cpp:
660         (WebKit::WebFrame::createSubframe):
661         Send parent frameID in addition to our own in the message to UIProcess.
662
663 2010-12-23  Anders Carlsson  <andersca@apple.com>
664
665         Reviewed by Sam Weinig.
666
667         New popup windows open disproportionately big
668         https://bugs.webkit.org/show_bug.cgi?id=51547
669         <rdar://problem/8637029>
670
671         * UIProcess/WebPageProxy.cpp:
672         (WebKit::WebPageProxy::createNewPage):
673         Pass the correct size back to the UI process.
674
675         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
676         (WebKit::WebChromeClient::pageRect):
677         Implement this and return the size of the page.
678
679 2010-12-23  Anders Carlsson  <andersca@apple.com>
680
681         Reviewed by John Sullivan.
682
683         Nothing happens clicking "launch live player" on live.cnn.com
684         https://bugs.webkit.org/show_bug.cgi?id=51540
685         <rdar://problem/8791086>
686
687         Implement NPN_PushPopupsEnabledState/NPN_PopPopupsEnabledState.
688
689         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
690         (WebKit::NPN_PushPopupsEnabledState):
691         Call NetscapePlugin::pushPopupsEnabledState.
692
693         (WebKit::NPN_PopPopupsEnabledState):
694         Call NetscapePlugin::popPopupsEnabledState.
695
696         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
697         (WebKit::NetscapePlugin::pushPopupsEnabledState):
698         Append the boolean to the vector.
699
700         (WebKit::NetscapePlugin::popPopupsEnabledState):
701         Remove the last boolean from the vector.
702
703         (WebKit::NetscapePlugin::allowPopups):
704         Return the last boolean from the vector.
705
706         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
707         * WebProcess/Plugins/PluginView.cpp:
708         (WebKit::PluginView::performJavaScriptURLRequest):
709         Update the "allowPopupsFromPlugin" state.
710
711 2010-12-22  Anders Carlsson  <andersca@apple.com>
712
713         Reviewed by Sam Weinig.
714
715         Webkit2: WebProcess crashes when Private browsing is turned on on yahoo.com
716         https://bugs.webkit.org/show_bug.cgi?id=51516
717         <rdar://problem/8766995>
718
719         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
720         (WebKit::NetscapePlugin::NPP_SetValue):
721         Add a null check for NPP_SetValue.
722
723 2010-12-22  Anders Carlsson  <andersca@apple.com>
724
725         Reviewed by Sam Weinig.
726
727         REGRESSION (WK2): Plugins swallow CMD-W, CMD-Q, and probably other shortcuts
728         https://bugs.webkit.org/show_bug.cgi?id=51515
729         <rdar://problem/8740926>
730
731         Always return false for keyboard events where the command key is down.
732
733         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
734         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
735
736 2010-12-22  Sam Weinig  <sam@webkit.org>
737
738         Reviewed by Darin Adler.
739
740         WebProcess should be terminated if invalid frameIDs are
741         passed to the UIProcess.
742         https://bugs.webkit.org/show_bug.cgi?id=51508
743
744         - Introduce a mechanism to mark a messages as invalid due to
745           reasons other than in ability to decode the message, eg. an
746           invalid frameID is passed in a message.
747
748         * Platform/CoreIPC/Connection.cpp:
749         (CoreIPC::Connection::Connection):
750         (CoreIPC::Connection::markCurrentlyDispatchedMessageAsInvalid): Sets
751         the m_didReceiveInvalidMessage bit so that it can be picked up in 
752         (CoreIPC::Connection::dispatchMessages): Check for m_didReceiveInvalidMessage in
753         addition to tainted arguments.
754         * Platform/CoreIPC/Connection.h:
755         Add base macro for others to extend, that calls markCurrentlyDispatchedMessageAsInvalid()
756         ASSERTs, and returns.
757
758         * UIProcess/WebPageProxy.cpp:
759         Add Message checks for all WebFrameProxy's gotten from frameIDs passed
760         over the wire.
761         * UIProcess/WebProcessProxy.cpp:
762         (WebKit::isGoodMapKey):
763         Checks that the key can be inserted safely into a map (eg. not the empty or deleted value).
764
765         (WebKit::WebProcessProxy::webFrame):
766         Return null for bad keys (eg. 0 or -1).
767
768         (WebKit::WebProcessProxy::canCreateFrame):
769         Added. Checks that the ID is good and not in the map yet. Used
770         as a consistency check before creating frames.
771
772         (WebKit::WebProcessProxy::frameCreated): 
773         ASSERT that the key is good, in addition to not in the map yet.
774
775         (WebKit::WebProcessProxy::didDestroyFrame):
776         ASSERT that the key is good.
777
778         * UIProcess/WebProcessProxy.h:
779         Move WebFrameProxy HashMap type into a typedef.
780
781 2010-12-22  Darin Adler  <darin@apple.com>
782
783         Reviewed by Anders Carlsson.
784
785         WebKit2 needs a way to return the main resource data
786         https://bugs.webkit.org/show_bug.cgi?id=51510
787
788         * UIProcess/API/C/WKFrame.cpp:
789         (WKFrameGetMainResourceData): Added.
790         (callGetMainResourceDataBlockAndDispose): Added.
791         (WKFrameGetMainResourceData_b): Added.
792         * UIProcess/API/C/WKFrame.h: Added WKFrameGetMainResourceData.
793
794         * UIProcess/WebFrameProxy.cpp:
795         (WebKit::WebFrameProxy::getMainResourceData): Added.
796         * UIProcess/WebFrameProxy.h: Ditto.
797
798         * UIProcess/WebPageProxy.cpp:
799         (WebKit::WebPageProxy::getMainResourceDataOfFrame): Added.
800         (WebKit::WebPageProxy::dataCallback): Replaced the individual callbacks
801         with just these two.
802         (WebKit::WebPageProxy::stringCallback): Ditto.
803         * UIProcess/WebPageProxy.h: Ditto.
804         * UIProcess/WebPageProxy.messages.in: Ditto.
805
806         * WebProcess/WebPage/WebPage.cpp:
807         (WebKit::WebPage::runJavaScriptInMainFrame): Send the string callback
808         message instead of a specific one.
809         (WebKit::WebPage::getContentsAsString): Ditto.
810         (WebKit::WebPage::getRenderTreeExternalRepresentation): Ditto.
811         (WebKit::WebPage::getSelectionOrContentsAsString): Ditto.
812         (WebKit::WebPage::getSourceForFrame): Ditto.
813         (WebKit::WebPage::getMainResourceDataOfFrame): Added.
814         (WebKit::WebPage::getWebArchiveOfFrame): Send the data callback message
815         instead of a specific one.
816         * WebProcess/WebPage/WebPage.h: Added getMainResourceDataOfFrame.
817         * WebProcess/WebPage/WebPage.messages.in: Ditto.
818
819 2010-12-22  Darin Adler  <darin@apple.com>
820
821         * WebProcess/WebPage/WebPage.cpp: Add #if to try to fix non-Mac builds.
822
823 2010-12-22  Darin Adler  <darin@apple.com>
824
825         Reviewed by Anders Carlsson.
826
827         Make Speech menu items work in WebKit2
828         https://bugs.webkit.org/show_bug.cgi?id=51504
829
830         * UIProcess/API/C/WKFrame.cpp:
831         (WKFrameGetWebArchive): Updated to use new-named typedef.
832         * UIProcess/API/C/WKPage.cpp:
833         (WKPageRunJavaScriptInMainFrame): Ditto.
834         (WKPageRenderTreeExternalRepresentation): Ditto.
835         (WKPageGetSourceForFrame): Ditto.
836         (WKPageGetContentsAsString): Ditto.
837
838         * UIProcess/API/mac/WKView.mm:
839         (menuItem): Added. Helper function to make it easy to call menu item
840         functions on arbitrary user interface items.
841         (toolbarItem): Ditto.
842         (-[WKView validateUserInterfaceItem:]): Added validation for startSpeaking
843         and stopSpeaking commands. Reworked the code to fix a bug where
844         toggleContinuousSpellChecking would always be enabled even when it should
845         be disabled. Reworked the asynchronous validation code so it works for
846         items other than menu items and can also handle more than one item for the
847         same command. Added some comments.
848         (speakString): Added. Helper function to be used as a callback when we
849         get the selection or contents to speak.
850         (-[WKView startSpeaking:]): Added. Uses getSelectionOrContentsAsString.
851         (-[WKView stopSpeaking:]): Added.
852         (-[WKView _setUserInterfaceItemState:enabled:state:]): Reworked to work
853         with the changes to validateUserInterfaceItem above.
854
855         * UIProcess/WebFrameProxy.cpp:
856         (WebKit::WebFrameProxy::isDisplayingMarkupDocument): Added a FIXME about
857         a problem I noticed.
858         (WebKit::WebFrameProxy::didCommitLoad): Tweaked argument name.
859         (WebKit::WebFrameProxy::getWebArchive): Changed to use new-named typedef.
860         * UIProcess/WebFrameProxy.h: Changed WebArchiveCallback to DataCallaback.
861
862         * UIProcess/WebPageProxy.cpp:
863         (WebKit::WebPageProxy::close): Invalidate the two callback maps since
864         we only have two now.
865         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Changed to use merged
866         maps and typedefs so we don't need a separate callback map for each function.
867         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): Ditto.
868         (WebKit::WebPageProxy::getSourceForFrame): Ditto.
869         (WebKit::WebPageProxy::getContentsAsString): Ditto.
870         (WebKit::WebPageProxy::getSelectionOrContentsAsString): Added.
871         (WebKit::WebPageProxy::getWebArchiveOfFrame): Ditto.
872         (WebKit::WebPageProxy::didGetContentsAsString): Ditto.
873         (WebKit::WebPageProxy::didGetSelectionOrContentsAsString): Ditto.
874         (WebKit::WebPageProxy::didRunJavaScriptInMainFrame): Ditto.
875         (WebKit::WebPageProxy::didGetRenderTreeExternalRepresentation): Ditto.
876         (WebKit::WebPageProxy::didGetSourceForFrame): Ditto.
877         (WebKit::WebPageProxy::didGetWebArchiveOfFrame): Ditto.
878         (WebKit::WebPageProxy::processDidCrash): Ditto.
879
880         * UIProcess/WebPageProxy.h: Updated for changes above.
881
882         * UIProcess/WebPageProxy.messages.in: Added DidGetSelectionOrContentsAsString,
883         GetIsSpeaking, Speak, and StopSpeaking.
884
885         * UIProcess/mac/WebPageProxyMac.mm:
886         (WebKit::WebPageProxy::getIsSpeaking): Added.
887         (WebKit::WebPageProxy::speak): Added.
888         (WebKit::WebPageProxy::stopSpeaking): Added.
889
890         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
891         (WebKit::WebContextMenuClient::isSpeaking): Call WebPage instead of doing
892         the work directly, so it can run in the UI process.
893         (WebKit::WebContextMenuClient::speak): Ditto.
894         (WebKit::WebContextMenuClient::stopSpeaking): Ditto.
895         (WebKit::WebContextMenuClient::searchWithSpotlight): Added FIXME comment and
896         changed code to avoid a C-style cast.
897
898         * WebProcess/WebPage/WebFrame.cpp:
899         (WebKit::WebFrame::selectionAsString): Added.
900         * WebProcess/WebPage/WebFrame.h: Ditto.
901
902         * WebProcess/WebPage/WebPage.cpp:
903         (WebKit::WebPage::changeAcceleratedCompositingMode): Use sendSync in the
904         modern way instead of explicitly calling WebProcess.
905         (WebKit::WebPage::getSelectionOrContentsAsString): Added.
906         (WebKit::WebPage::isSpeaking): Added.
907         (WebKit::WebPage::speak): Added.
908         (WebKit::WebPage::stopSpeaking): Added.
909         * WebProcess/WebPage/WebPage.h: Added functions.
910
911         * WebProcess/WebPage/WebPage.messages.in: Added GetSelectionOrContentsAsString.
912
913 2010-12-22  Anders Carlsson  <andersca@apple.com>
914
915         Fix build.
916
917         * Platform/mac/MachUtilities.cpp:
918
919 2010-12-22  Anders Carlsson  <andersca@apple.com>
920
921         Reviewed by Darin Adler.
922
923         Detect WebProcess crashes sooner, without waiting for ReportCrash to finish
924         https://bugs.webkit.org/show_bug.cgi?id=51505
925
926         * Platform/CoreIPC/CoreIPCMessageKinds.h:
927         Add SetExceptionPort.
928
929         * Platform/CoreIPC/mac/ConnectionMac.cpp:
930         (CoreIPC::Connection::platformInvalidate):
931         If we have an exception port, unregister it.
932
933         (CoreIPC::Connection::platformInitialize):
934         Set m_exceptionPort to null.
935
936         (CoreIPC::Connection::open):
937         If we have an exception port, register an event handler for it and send it over
938         to the other side.
939
940         (CoreIPC::Connection::receiveSourceEventHandler):
941         Handle the SetExceptionPort message.
942
943         (CoreIPC::Connection::exceptionSourceEventHandler):
944         Receive the message, forward it to the real exception handler and call connectionDidClose.
945
946         (CoreIPC::Connection::setShouldCloseConnectionOnMachExceptions):
947         Create an exception port.
948
949         * Platform/mac/MachUtilities.cpp:
950         (machExceptionPort):
951         (setMachExceptionPort):
952         * Platform/mac/MachUtilities.h:
953         Add helper functions for getting and setting the mach exception port.
954
955         * UIProcess/WebProcessProxy.cpp:
956         (WebKit::WebProcessProxy::didFinishLaunching):
957         Call setShouldCloseConnectionOnMachExceptions on Mac.
958
959 2010-12-22  Anders Carlsson  <andersca@apple.com>
960
961         Reviewed by Sam Weinig.
962
963         Move Mach message receiving code out into a new function
964         https://bugs.webkit.org/show_bug.cgi?id=51502
965
966         * Platform/CoreIPC/mac/ConnectionMac.cpp:
967         (CoreIPC::readFromMachPort):
968         (CoreIPC::Connection::receiveSourceEventHandler):
969
970 2010-12-22  Jeff Miller  <jeffm@apple.com>
971
972         Reviewed by Sam Weinig.
973
974         InjectedBundle methods should  use the relative URL constructor for KURL instead of the ParsedURLStringTag version
975         https://bugs.webkit.org/show_bug.cgi?id=51491
976         
977         The url passed to various InjectedBundle methods is not from KURL::string(), i.e. it has not already been parsed by KURL,
978         so we have to use the relative URL constructor for KURL instead of the ParsedURLStringTag version.
979
980         * WebProcess/InjectedBundle/InjectedBundle.cpp:
981         (WebKit::InjectedBundle::addUserScript):
982         (WebKit::InjectedBundle::addUserStyleSheet):
983         (WebKit::InjectedBundle::removeUserScript):
984         (WebKit::InjectedBundle::removeUserStyleSheet):
985
986 2010-12-22  Darin Adler  <darin@apple.com>
987
988         Reviewed by Sam Weinig.
989
990         Move more of WebPageProxy::didCommitLoadForFrame into WebFrameProxy::didCommitLoad.
991
992         * UIProcess/WebFrameProxy.cpp:
993         (WebKit::WebFrameProxy::didCommitLoad): Added type and certificate info arguments,
994         and set m_MIMEType, m_isFrameSet, and m_certificateInfo.
995         * UIProcess/WebFrameProxy.h: Removed setMIMEType and setCertificateInfo and added
996         arguments to didCommitLoad.
997         * UIProcess/WebPageProxy.cpp:
998         (WebKit::WebPageProxy::didCommitLoadForFrame): Removed code that is now inside the
999         WebFrameProxy::didCommitLoad function.
1000
1001 2010-12-21  Darin Adler  <darin@apple.com>
1002
1003         Reviewed by Brady Eidson and Sam Weinig.
1004
1005         Add a way to get a web archive in WebKit2
1006         https://bugs.webkit.org/show_bug.cgi?id=51437
1007
1008         * UIProcess/API/C/WKFrame.cpp:
1009         (WKFrameGetWebArchive): Added.
1010         (callGetWebArchiveBlockAndDispose): Added.
1011         (WKFrameGetWebArchive_b): Added.
1012         * UIProcess/API/C/WKFrame.h: Added functions above.
1013         * UIProcess/WebPageProxy.cpp:
1014         (WebKit::WebPageProxy::close): Clear out m_webArchiveCallbacks.
1015         (WebKit::WebPageProxy::getWebArchiveOfFrame): Added.
1016         (WebKit::WebPageProxy::didGetWebArchiveOfFrame): Added.
1017         (WebKit::WebPageProxy::processDidCrash): Clear out m_webArchiveCallbacks.
1018         * UIProcess/WebPageProxy.h: Added functions above.
1019         * UIProcess/WebPageProxy.messages.in: Added DidGetWebArchiveOfFrame.
1020         * WebProcess/WebPage/WebPage.cpp:
1021         (WebKit::WebPage::getWebArchiveOfFrame): Added.
1022         * WebProcess/WebPage/WebPage.h: Added function above.
1023         * WebProcess/WebPage/WebPage.messages.in: Added GetWebArchiveOfFrame.
1024
1025 2010-12-21  Siddharth Mathur  <siddharth.mathur@nokia.com>
1026
1027         Reviewed by Laszlo Gombos.
1028
1029         [Qt] [WK2] Guard gcc-specific syntax
1030
1031         * WebKit2.pro: Non-gcc based compliers choke on the "-include" 
1032         syntax for preinclude, make sure it has guard around it.
1033
1034 2010-12-21  Anders Carlsson  <andersca@apple.com>
1035
1036         Reviewed by Darin Adler.
1037
1038         Can't stop QT music on santastreefarm.com
1039         https://bugs.webkit.org/show_bug.cgi?id=51438
1040         <rdar://problem/8741152>
1041
1042         Implement NPN_ConvertPoint.
1043
1044         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1045         (WebKit::NPN_ConvertPoint):
1046         Call NetscapePlugin::convertPoint.
1047
1048         (WebKit::initializeBrowserFuncs):
1049         Only initialize NPN_ConvertPoint and NPN_PopUpContextMenu on Mac.
1050
1051         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1052         (WebKit::NetscapePlugin::convertPoint):
1053         Implement conversion routines.
1054
1055         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
1056         Keep track of the window and view frames, they are needed to do coordinate conversion.
1057
1058 2010-12-21  Sam Weinig  <weinig@apple.com>
1059
1060         Reviewed by Anders Carlsson.
1061
1062         Implement encoding/decoding of ResourceRequest and 
1063         ResourceResponse for Windows/CFNetwork.
1064
1065         * Shared/win/WebCoreArgumentCodersWin.cpp:
1066         (CoreIPC::encodeResourceRequest):
1067         (CoreIPC::decodeResourceRequest):
1068         (CoreIPC::encodeResourceResponse):
1069         (CoreIPC::decodeResourceResponse):
1070         * win/WebKit2.vcproj:
1071         * win/WebKit2Common.vsprops:
1072
1073 2010-12-21  Darin Adler  <darin@apple.com>
1074
1075         Reviewed by Sam Weinig.
1076
1077         Mac WebKit delivers an extra didCommit when loading web archives
1078         https://bugs.webkit.org/show_bug.cgi?id=51419
1079
1080         * UIProcess/WebFrameProxy.cpp:
1081         (WebKit::WebFrameProxy::didStartProvisionalLoad): Added assertions so we catch
1082         inconsistencies here instead of at the application level. Later, we will have
1083         to decide what to do in cases these assertions fail. The right policy is probably
1084         to consider it a web process failure and do whatever we do for those.
1085         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): Ditto.
1086         (WebKit::WebFrameProxy::didFailProvisionalLoad): Ditto.
1087         (WebKit::WebFrameProxy::didCommitLoad): Ditto.
1088         (WebKit::WebFrameProxy::didFinishLoad): Ditto.
1089         (WebKit::WebFrameProxy::didFailLoad): Ditto.
1090
1091 2010-12-21  Anders Carlsson  <andersca@apple.com>
1092
1093         Fix Snow Leopard build.
1094
1095         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1096         (WebKit::NPN_GetValue):
1097
1098 2010-12-21  Anders Carlsson  <andersca@apple.com>
1099
1100         Reviewed by Dan Bernstein.
1101
1102         Fix crash when a Carbon plug-in fails to initialize correctly
1103         https://bugs.webkit.org/show_bug.cgi?id=51415
1104
1105         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1106         (WebKit::NPN_GetValue):
1107         Don't claim to support the QuickDraw event model.
1108
1109         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1110         (WebKit::NetscapePlugin::platformDestroy):
1111         Only try to remove the window from the map if it's not null.
1112
1113 2010-12-21  Anders Carlsson  <andersca@apple.com>
1114
1115         Reviewed by Darin Adler.
1116
1117         Add ArgumentCoder support for CFDataRef
1118         https://bugs.webkit.org/show_bug.cgi?id=51412
1119
1120         * Shared/cf/ArgumentCodersCF.cpp:
1121         (CoreIPC::typeFromCFTypeRef):
1122         (CoreIPC::encode):
1123         (CoreIPC::decode):
1124         * Shared/cf/ArgumentCodersCF.h:
1125
1126 2010-12-21  Anders Carlsson  <andersca@apple.com>
1127
1128         Reviewed by John Sullivan.
1129
1130         Clicking missing plug-in text does not show a sheet
1131         https://bugs.webkit.org/show_bug.cgi?id=51403
1132
1133         * UIProcess/API/C/WKPage.h:
1134         Add missingPluginButtonClicked to WKPageUIClient.
1135
1136         * UIProcess/WebPageProxy.cpp:        
1137         (WebKit::WebPageProxy::missingPluginButtonClicked):
1138         Call the WebUIClient member function.
1139
1140         * UIProcess/WebPageProxy.messages.in:
1141         Add MissingPluginButtonClicked message.
1142
1143         * UIProcess/WebUIClient.cpp:
1144         (WebKit::WebUIClient::missingPluginButtonClicked):
1145         Call the WKPageUIClient callback.
1146
1147         * UIProcess/WebUIClient.h:
1148         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1149         (WebKit::WebChromeClient::shouldMissingPluginMessageBeButton):
1150         Always return true for now.
1151
1152         (WebKit::WebChromeClient::missingPluginButtonClicked):
1153         Send a MissingPluginButtonClicked message.
1154
1155 2010-12-21  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1156
1157         Reviewed by Andreas Kling.
1158
1159         [Qt] Set BUILDING_QT__ consistently
1160         https://bugs.webkit.org/show_bug.cgi?id=51341
1161
1162         * WebKit2.pro: Remove the definition of BUILDING_QT__ as it
1163         is already defined in WebKit.pri.
1164
1165 2010-12-20  Sam Weinig  <sam@webkit.org>
1166
1167         Reviewed by Anders Carlsson.
1168
1169         WebKit2: Add resource load client API
1170         https://bugs.webkit.org/show_bug.cgi?id=51370
1171
1172         This just pipes through the basic resource load client data.
1173
1174         * UIProcess/API/C/WKPage.cpp:
1175         (WKPageSetPageResourceLoadClient):
1176         * UIProcess/API/C/WKPage.h:
1177         * UIProcess/WebPageProxy.cpp:
1178         (WebKit::WebPageProxy::initializeResourceLoadClient):
1179         (WebKit::WebPageProxy::didInitiateLoadForResource):
1180         (WebKit::WebPageProxy::didSendRequestForResource):
1181         (WebKit::WebPageProxy::didReceiveResponseForResource):
1182         (WebKit::WebPageProxy::didReceiveContentLengthForResource):
1183         (WebKit::WebPageProxy::didFinishLoadForResource):
1184         (WebKit::WebPageProxy::didFailLoadForResource):
1185         * UIProcess/WebPageProxy.h:
1186         * UIProcess/WebPageProxy.messages.in:
1187         * UIProcess/WebResourceLoadClient.cpp: Added.
1188         (WebKit::WebResourceLoadClient::didInitiateLoadForResource):
1189         (WebKit::WebResourceLoadClient::didSendRequestForResource):
1190         (WebKit::WebResourceLoadClient::didReceiveResponseForResource):
1191         (WebKit::WebResourceLoadClient::didReceiveContentLengthForResource):
1192         (WebKit::WebResourceLoadClient::didFinishLoadForResource):
1193         (WebKit::WebResourceLoadClient::didFailLoadForResource):
1194         * UIProcess/WebResourceLoadClient.h: Added.
1195         * WebKit2.pro:
1196         * WebKit2.xcodeproj/project.pbxproj:
1197         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1198         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
1199         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
1200         (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
1201         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
1202         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
1203         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
1204         * win/WebKit2.vcproj:
1205
1206 2010-12-20  Anders Carlsson  <andersca@apple.com>
1207
1208         Reviewed by Sam Weinig.
1209
1210         Add a TextChecker class, hook up spelling and grammar toggling
1211         https://bugs.webkit.org/show_bug.cgi?id=51363
1212
1213         * UIProcess/API/mac/WKView.mm:
1214         (-[WKView validateUserInterfaceItem:]):
1215         (-[WKView toggleContinuousSpellChecking:]):
1216         (-[WKView toggleGrammarChecking:]):
1217         * UIProcess/TextChecker.h: Added.
1218         * UIProcess/WebPageProxy.cpp:
1219         (WebKit::WebPageProxy::unmarkAllMisspellings):
1220         (WebKit::WebPageProxy::unmarkAllBadGrammar):
1221         * UIProcess/WebPageProxy.h:
1222         * UIProcess/mac/TextCheckerMac.mm: Added.
1223         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
1224         (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
1225         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
1226         (WebKit::TextChecker::isGrammarCheckingEnabled):
1227         (WebKit::TextChecker::setGrammarCheckingEnabled):
1228         * UIProcess/qt/TextCheckerQt.cpp: Added.
1229         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
1230         (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
1231         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
1232         (WebKit::TextChecker::isGrammarCheckingEnabled):
1233         (WebKit::TextChecker::setGrammarCheckingEnabled):
1234         * UIProcess/win/TextCheckerWin.cpp: Added.
1235         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
1236         (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
1237         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
1238         (WebKit::TextChecker::isGrammarCheckingEnabled):
1239         (WebKit::TextChecker::setGrammarCheckingEnabled):
1240         * WebKit2.pro:
1241         * WebKit2.xcodeproj/project.pbxproj:
1242         * WebProcess/WebPage/WebPage.cpp:
1243         (WebKit::WebPage::unmarkAllMisspellings):
1244         (WebKit::WebPage::unmarkAllBadGrammar):
1245         * WebProcess/WebPage/WebPage.h:
1246         * WebProcess/WebPage/WebPage.messages.in:
1247         * win/WebKit2.vcproj:
1248
1249 2010-12-20  Anders Carlsson  <andersca@apple.com>
1250
1251         Reviewed by Sam Weinig.
1252
1253         Flash plug-in does not work on YouTube video page when accelerated compositing is disabled
1254         https://bugs.webkit.org/show_bug.cgi?id=51348
1255         <rdar://problem/8787667>
1256
1257         * Platform/CoreIPC/HandleMessage.h:
1258         (CoreIPC::callMemberFunction):
1259         Add new overload.
1260
1261         * PluginProcess/PluginControllerProxy.cpp:
1262         (WebKit::PluginControllerProxy::create):
1263         (WebKit::PluginControllerProxy::PluginControllerProxy):
1264         These now take an additional isAcceleratedCompositingEnabled parameter.
1265
1266         (WebKit::PluginControllerProxy::isAcceleratedCompositingEnabled):
1267         Return m_isAcceleratedCompositingEnabled.
1268
1269         * PluginProcess/PluginControllerProxy.h:
1270         * PluginProcess/WebProcessConnection.cpp:
1271         (WebKit::WebProcessConnection::createPlugin):
1272         This now takes an additional isAcceleratedCompositingEnabled parameter.
1273
1274         * PluginProcess/WebProcessConnection.messages.in:
1275         Add isAcceleratedCompositingEnabled parameter to the CreatePlugin message.
1276
1277         * WebProcess/Plugins/PluginProxy.cpp:
1278         (WebKit::PluginProxy::initialize):
1279         Pass isAcceleratedCompositingEnabled when sending the CreatePlugin message.
1280
1281 2010-12-20  Anders Carlsson  <andersca@apple.com>
1282
1283         Unreviewed, rolling out r74345.
1284         http://trac.webkit.org/changeset/74345
1285         https://bugs.webkit.org/show_bug.cgi?id=51115
1286
1287         Not the correct fix.
1288
1289         * Platform/CoreIPC/Connection.h:
1290         * Platform/CoreIPC/qt/ConnectionQt.cpp:
1291         (CoreIPC::Connection::open):
1292
1293 2010-12-20  Balazs Kelemen  <kbalazs@webkit.org>
1294
1295         Reviewed by Kenneth Rohde Christiansen.
1296
1297         [Qt][WK2] Crash in web process after the connection had been closed
1298         https://bugs.webkit.org/show_bug.cgi?id=51115
1299
1300         Do not call connectionDidClose with a connection that has been explicitly
1301         invalidated on the listener thread.
1302         * Platform/CoreIPC/Connection.h:
1303         * Platform/CoreIPC/qt/ConnectionQt.cpp:
1304         (CoreIPC::Connection::disconnectHandler): Added.
1305         (CoreIPC::Connection::open):
1306
1307 2010-12-19  Dan Bernstein  <mitz@apple.com>
1308
1309         Reviewed by Sam Weinig.
1310
1311         Improve the fix for <rdar://problem/8769525>.
1312
1313         * UIProcess/API/mac/WKView.mm:
1314         (-[WKView performKeyEquivalent:]): Do not retain the view. Doing so is necessary in
1315         -[WebHTMLView performKeyEquivalent:], which this method was based upon, but not here, because
1316         there is no way for the web process to cause the WKView to be released while it is handling
1317         the event.
1318
1319 2010-12-19  Dan Bernstein  <mitz@apple.com>
1320
1321         Reviewed by Sam Weinig.
1322
1323         <rdar://problem/8769525> WKView leak when performing key equivalents
1324         https://bugs.webkit.org/show_bug.cgi?id=51315
1325
1326         * UIProcess/API/mac/WKView.mm:
1327         (-[WKView performKeyEquivalent:]): Use a RetainPtr to ensure that the view is released in the
1328         early return code path.
1329
1330 2010-12-19  Benjamin Poulain  <benjamin.poulain@nokia.com>
1331
1332         Reviewed by Kenneth Rohde Christiansen.
1333
1334         [Qt] [WK2] QWKPagePrivate::paint() does not need to save the graphics context
1335         https://bugs.webkit.org/show_bug.cgi?id=51300
1336
1337         Remove the unnecessary save() and restore() on the QPainter.
1338
1339         * UIProcess/API/qt/qwkpage.cpp:
1340         (QWKPagePrivate::paint):
1341
1342 2010-12-19  Kenneth Rohde Christiansen  <kenneth@webkit.org>
1343
1344         Reviewed by Andreas Kling.
1345
1346         [Qt] [WK2] Client are expected to render their own background for WebPages
1347         https://bugs.webkit.org/show_bug.cgi?id=51296
1348
1349         Remove the rendering of the checkerboard from the tiled DrawingAreaProxy
1350
1351         * UIProcess/TiledDrawingAreaProxy.cpp:
1352         (WebKit::TiledDrawingAreaProxy::paint):
1353         * UIProcess/TiledDrawingAreaTile.h:
1354         * UIProcess/qt/TiledDrawingAreaTileQt.cpp:
1355
1356 2010-12-19  Benjamin Poulain  <benjamin.poulain@nokia.com>
1357
1358         Reviewed by Kenneth Rohde Christiansen.
1359
1360         [Qt] [WK2] Client are expected to render their own background for WebPages
1361         https://bugs.webkit.org/show_bug.cgi?id=51296
1362
1363         Do not render a white background before rendering the page with DrawingAreaProxy.
1364
1365         * UIProcess/API/qt/qwkpage.cpp:
1366         (QWKPagePrivate::paint):
1367
1368 2010-12-17  Darin Adler  <darin@apple.com>
1369
1370         Reviewed by Dan Bernstein.
1371
1372         Window title for image documents shows corrupted characters instead of multiplication sign when using WebKit2
1373         https://bugs.webkit.org/show_bug.cgi?id=43505
1374
1375         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Changed UI_STRING macros to return
1376         WebCore::String objects instead of C strings.
1377         (WebKit::formatLocalizedString): Added. Uses the Core Foundation string formatting function for
1378         reasons explained in the comment.
1379         (WebKit::WebPlatformStrategies::multipleFileUploadText): Use formatLocalizedString instead of
1380         String::format.
1381         (WebKit::WebPlatformStrategies::imageTitle): Ditto.
1382         (WebKit::WebPlatformStrategies::localizedMediaTimeDescription): Ditto.
1383
1384 2010-12-17  Anders Carlsson  <andersca@apple.com>
1385
1386         Reviewed by Sam Weinig.
1387
1388         Resizing a WKView while loading a page can leave the page at a size that doesn't match the window
1389         https://bugs.webkit.org/show_bug.cgi?id=51282
1390         <rdar://problem/8133142>
1391
1392         Fix a race condition in waitForMessage. If we time out on the wait condition, we would keep the
1393         m_waitForMessageMutex mutex unlocked for a brief period of time before taking the lock again and
1394         then removing the messageID/destinationID pair from the hash map. Under some circumstances, the
1395         connection queue would update the hash map right before we removed it, leading to a lost message.
1396         
1397         * Platform/CoreIPC/Connection.cpp:
1398         (CoreIPC::Connection::waitForMessage):
1399
1400 2010-12-17  Anders Carlsson  <andersca@apple.com>
1401
1402         Reviewed by Simon Fraser.
1403
1404         Clean up ChunkedUpdateDrawingAreaProxy
1405         https://bugs.webkit.org/show_bug.cgi?id=51277
1406
1407         Get rid of m_lastSetViewSize since it was always equal to m_size.
1408
1409         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1410         (WebKit::ChunkedUpdateDrawingAreaProxy::sizeDidChange):
1411         Call sendSetSize().
1412
1413         (WebKit::ChunkedUpdateDrawingAreaProxy::didSetSize):
1414         Call sendSetSize if the size differs.
1415
1416         (WebKit::ChunkedUpdateDrawingAreaProxy::sendSetSize):
1417         Move code from sizeDidChange over here.
1418
1419         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1420         * UIProcess/DrawingAreaProxy.cpp:
1421         (WebKit::DrawingAreaProxy::setSize):
1422         Add back the early return if the sizes are equal.
1423
1424 2010-12-17  Brent Fulgham  <bfulgham@webkit.org>
1425
1426         Unreviewed build fix.
1427
1428         * WebProcess/WebPage/win/WebPageWin.cpp:
1429         (WebKit::WebPage::canHandleRequest): Provide alternative for
1430         non-CFNetwork implementation.
1431
1432 2010-12-17  Ada Chan  <adachan@apple.com>
1433
1434         Reviewed by Anders Carlsson.
1435
1436         Implement WKView::setInitialFocus().
1437         https://bugs.webkit.org/show_bug.cgi?id=51274
1438
1439         * UIProcess/API/C/win/WKView.cpp:
1440         (WKViewSetInitialFocus):
1441         * UIProcess/API/C/win/WKView.h:
1442         * UIProcess/WebPageProxy.cpp:
1443         (WebKit::WebPageProxy::setInitialFocus): Send message to the Web Process to set
1444         initial focus.
1445         * UIProcess/WebPageProxy.h:
1446         * UIProcess/win/WebView.cpp:
1447         (WebKit::WebView::setInitialFocus):
1448         * UIProcess/win/WebView.h:
1449         * WebProcess/WebPage/WebPage.cpp:
1450         (WebKit::WebPage::setInitialFocus): Set the focused node to null initially.  Then
1451         ask FocusController to set the initial focus based on the focus direction.
1452         * WebProcess/WebPage/WebPage.h:
1453         * WebProcess/WebPage/WebPage.messages.in: Add a new message for SetInitialFocus.
1454
1455 2010-12-17  Anders Carlsson  <andersca@apple.com>
1456
1457         Reviewed by Sam Weinig.
1458
1459         Remove a check that probably uncovered a resizing bug.
1460
1461         * UIProcess/DrawingAreaProxy.cpp:
1462         (WebKit::DrawingAreaProxy::setSize):
1463
1464 2010-12-17  Brian Weinstein  <bweinstein@apple.com>
1465
1466         Qt build fix.
1467
1468         * UIProcess/qt/WebPopupMenuProxyQt.h:
1469
1470 2010-12-17  Brian Weinstein  <bweinstein@apple.com>
1471
1472         Reviewed by Anders Carlsson.
1473
1474         Text area does not update when you arrow through a <select> in WebKit2
1475         https://bugs.webkit.org/show_bug.cgi?id=51269
1476         <rdar://problem/8612853>
1477         
1478         Patch by Sam Weinig.
1479         
1480         Insteaed of keeping track of the selected index of a <select> just in the UI process, we
1481         need to pass this information along to the web process so that the web process can draw
1482         the correct text in the text field at the top of the select, when the selection changes (via
1483         the arrows or other typing while the select is opened).
1484         
1485         When the selected item in a popup changes, the UI process sends a message to the web process, telling
1486         it about the new selected index. The web process gets this message, and then sets the text that
1487         is visible in the select element.
1488
1489         * UIProcess/API/mac/PageClientImpl.h: CreatePopupMenuProxy now takes a WebPageProxy.
1490         * UIProcess/API/mac/PageClientImpl.mm:
1491         (WebKit::PageClientImpl::createPopupMenuProxy): Pass the WebPageProxy to create.
1492         * UIProcess/API/qt/qwkpage.cpp:
1493         (QWKPagePrivate::createPopupMenuProxy):
1494         * UIProcess/API/qt/qwkpage_p.h: CreatePopupMenuProxy now takes a WebPageProxy.
1495         * UIProcess/PageClient.h: CreatePopupMenuProxy now takes a WebPageProxy.
1496         * UIProcess/WebPageProxy.cpp:
1497         (WebKit::WebPageProxy::valueChangedForPopupMenu): Send that the selected index changed to the 
1498             web process.selected
1499         (WebKit::WebPageProxy::setTextFromItemForPopupMenu): Send that we should update the text for the
1500             active popup menu (with the index of the item to show).
1501         (WebKit::WebPageProxy::showPopupMenu): Pass the WebPageProxy to createPopupMenuProxy.
1502         * UIProcess/WebPageProxy.h:
1503         * UIProcess/WebPopupMenuProxy.h: Add a client who has virtual functions for the state changing of the
1504             popup menu. ShowPopupMenu doesn't take a new selected index anymore, that is handled by the client,
1505             and calling down to the web process.
1506         (WebKit::WebPopupMenuProxy::Client::~Client):
1507         (WebKit::WebPopupMenuProxy::WebPopupMenuProxy): Initialize the client.
1508         * UIProcess/mac/WebPopupMenuProxyMac.h:
1509         (WebKit::WebPopupMenuProxyMac::create): Takes a WebPopupMenuProxy::Client, and passes it to the constructor.
1510         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1511         (WebKit::WebPopupMenuProxyMac::WebPopupMenuProxyMac): Update what's initialized by the constructor.
1512         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Call through to the web process that the value changed.
1513         * UIProcess/qt/WebPopupMenuProxyQt.cpp:
1514         (WebKit::WebPopupMenuProxyQt::WebPopupMenuProxyQt): Update what's initialized by the constructor.
1515         * UIProcess/win/WebPopupMenuProxyWin.cpp:
1516         (WebKit::WebPopupMenuProxyWin::WebPopupMenuProxyWin): Ditto.
1517         (WebKit::WebPopupMenuProxyWin::showPopupMenu): Call through to the web process that the value changed.
1518         (WebKit::WebPopupMenuProxyWin::setFocusedIndex): Resolve a FIXME to set the text of the popup menu.
1519         * UIProcess/win/WebPopupMenuProxyWin.h:
1520         (WebKit::WebPopupMenuProxyWin::create): Take in a WebPopupMenuProxy::client, and pass it to the constructor.
1521         * UIProcess/win/WebView.cpp:
1522         (WebKit::WebView::createPopupMenuProxy): Pass the WebPageProxy to create.
1523         * UIProcess/win/WebView.h:
1524         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
1525         (WebKit::WebPopupMenu::setTextForIndex): Call through to setTextFromItem to set the select text.
1526         * WebProcess/WebCoreSupport/WebPopupMenu.h:
1527         * WebProcess/WebPage/WebPage.cpp: Call through to setTextForIndex on the active popup menu.
1528         (WebKit::WebPage::setTextForActivePopupMenu):
1529         * WebProcess/WebPage/WebPage.h:
1530         * WebProcess/WebPage/WebPage.messages.in: Add a new message.
1531
1532 2010-12-17  Anders Carlsson  <andersca@apple.com>
1533
1534         Reviewed by Sam Weinig.
1535
1536         DrawingAreaProxy::setSize shouldn't be a virtual member function
1537         https://bugs.webkit.org/show_bug.cgi?id=51275
1538
1539         Add a pure virtual sizeDidChange member function to DrawingAreaProxy, and only
1540         call it if the size changes.
1541
1542         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1543         (WebKit::ChunkedUpdateDrawingAreaProxy::sizeDidChange):
1544         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1545         * UIProcess/DrawingAreaProxy.cpp:
1546         (WebKit::DrawingAreaProxy::setSize):
1547         * UIProcess/DrawingAreaProxy.h:
1548         (WebKit::DrawingAreaProxy::size):
1549         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
1550         (WebKit::LayerBackedDrawingAreaProxy::sizeDidChange):
1551         * UIProcess/LayerBackedDrawingAreaProxy.h:
1552         * UIProcess/TiledDrawingAreaProxy.cpp:
1553         (WebKit::TiledDrawingAreaProxy::sizeDidChange):
1554         * UIProcess/TiledDrawingAreaProxy.h:
1555
1556 2010-12-17  Anders Carlsson  <andersca@apple.com>
1557
1558         Reviewed by Sam Weinig.
1559
1560         Add a WebPageProxy parameter to the DrawingAreaProxy constructor
1561         https://bugs.webkit.org/show_bug.cgi?id=51271
1562
1563         * UIProcess/API/mac/WKView.mm:
1564         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
1565         (-[WKView _switchToDrawingAreaTypeIfNecessary:DrawingAreaInfo::]):
1566         * UIProcess/API/qt/qgraphicswkview.cpp:
1567         (QGraphicsWKView::QGraphicsWKView):
1568         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
1569         (WebKit::ChunkedUpdateDrawingAreaProxy::create):
1570         (WebKit::ChunkedUpdateDrawingAreaProxy::ChunkedUpdateDrawingAreaProxy):
1571         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1572         * UIProcess/DrawingAreaProxy.cpp:
1573         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
1574         * UIProcess/DrawingAreaProxy.h:
1575         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
1576         (WebKit::LayerBackedDrawingAreaProxy::create):
1577         (WebKit::LayerBackedDrawingAreaProxy::LayerBackedDrawingAreaProxy):
1578         * UIProcess/LayerBackedDrawingAreaProxy.h:
1579         * UIProcess/TiledDrawingAreaProxy.cpp:
1580         (WebKit::TiledDrawingAreaProxy::create):
1581         (WebKit::TiledDrawingAreaProxy::TiledDrawingAreaProxy):
1582         * UIProcess/TiledDrawingAreaProxy.h:
1583         * UIProcess/win/WebView.cpp:
1584         (WebKit::WebView::WebView):
1585         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary):
1586
1587 2010-12-17  Dan Bernstein  <mitz@apple.com>
1588
1589         Reviewed by Darin Adler.
1590
1591         Add API for "Always Use the Complex Text Code Path"
1592         https://bugs.webkit.org/show_bug.cgi?id=51265
1593
1594         * Shared/WebProcessCreationParameters.cpp:
1595         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Initialize shouldAlwaysUseComplexTextCodePath.
1596         (WebKit::WebProcessCreationParameters::encode): Encode shouldAlwaysUseComplexTextCodePath.
1597         (WebKit::WebProcessCreationParameters::decode): Decode shouldAlwaysUseComplexTextCodePath.
1598         * Shared/WebProcessCreationParameters.h:
1599         * UIProcess/API/C/WKContext.cpp: 
1600         (_WKContextSetAlwaysUsesComplexTextCodePath): Added.
1601         * UIProcess/API/C/WKContextPrivate.h:
1602         * UIProcess/WebContext.cpp:
1603         (WebKit::WebContext::WebContext): Initialize m_alwaysUsesComplexTextCodePath.
1604         (WebKit::WebContext::ensureWebProcess): Set shouldAlwaysUseComplexTextCodePath in the creation parameters.
1605         (WebKit::WebContext::setAlwaysUsesComplexTextCodePath): Added. Sets m_alwaysUsesComplexTextCodePath and
1606         sends a message to the WebProcess.
1607         * UIProcess/WebContext.h:
1608         * WebProcess/WebProcess.cpp:
1609         (WebKit::WebProcess::initializeWebProcess): Call setAlwaysUsesComplexTextCodePath() based on the creation
1610         parameters.
1611         (WebKit::WebProcess::setAlwaysUsesComplexTextCodePath): Added.
1612         * WebProcess/WebProcess.h:
1613         * WebProcess/WebProcess.messages.in: Added SetAlwaysUsesComplexTextCodePath.
1614
1615 2010-12-17  Sam Weinig  <sam@webkit.org>
1616
1617         Reviewed by Darin Adler.
1618
1619         WebKit2: Implement a title attribute per frame
1620         https://bugs.webkit.org/show_bug.cgi?id=51266
1621
1622         Cache the title of each frame on the WebFrameProxy. Removes
1623         the WebPageProxy's cache of the main frame title to just
1624         access the main frame.
1625
1626         We clear the cached title on new committed loads and on failures
1627         to load.
1628
1629         * UIProcess/API/C/WKFrame.cpp:
1630         (WKFrameCopyTitle):
1631         * UIProcess/API/C/WKFrame.h:
1632         * UIProcess/WebFrameProxy.cpp:
1633         (WebKit::WebFrameProxy::didCommitLoad):
1634         (WebKit::WebFrameProxy::didFailLoad):
1635         (WebKit::WebFrameProxy::didChangeTitle):
1636         * UIProcess/WebFrameProxy.h:
1637         (WebKit::WebFrameProxy::title):
1638         * UIProcess/WebPageProxy.cpp:
1639         (WebKit::WebPageProxy::close):
1640         (WebKit::WebPageProxy::pageTitle):
1641         (WebKit::WebPageProxy::didReceiveTitleForFrame):
1642         (WebKit::WebPageProxy::processDidCrash):
1643         * UIProcess/WebPageProxy.h:
1644
1645 2010-12-16  Darin Adler  <darin@apple.com>
1646
1647         Reviewed by Maciej Stachowiak.
1648
1649         Add text encoding menu API for WebKit2
1650         https://bugs.webkit.org/show_bug.cgi?id=51226
1651
1652         * UIProcess/API/C/WKPage.cpp:
1653         (WKPageSupportsTextEncoding): Added.
1654         (WKPageCopyCustomTextEncodingName): Added.
1655         (WKPageSetCustomTextEncodingName): Added.
1656         * UIProcess/API/C/WKPage.h: Added the functions above.
1657
1658         * UIProcess/WebPageProxy.cpp:
1659         (WebKit::WebPageProxy::WebPageProxy): Initialize
1660         m_mainFrameHasCustomRepresentation to false.
1661         (WebKit::WebPageProxy::supportsTextEncoding): Added.
1662         (WebKit::WebPageProxy::setCustomTextEncodingName): Added.
1663         (WebKit::WebPageProxy::didCommitLoadForFrame): Set
1664         m_mainFrameHasCustomRepresentation.
1665
1666         * UIProcess/WebPageProxy.h: Added supportsTextEncoding,
1667         setCustomTextEncodingName, customTextEncodingName, and
1668         m_mainFrameHasCustomRepresentation.
1669
1670         * UIProcess/WebPageProxy.messages.in: Tweaked formatting
1671         (added a blank line).
1672
1673         * WebProcess/WebPage/WebPage.cpp:
1674         (WebKit::WebPage::setCustomTextEncodingName): Added.
1675         * WebProcess/WebPage/WebPage.h: Added setCustomTextEncodingName.
1676
1677         * WebProcess/WebPage/WebPage.messages.in: Added the
1678         SetCustomTextEncodingName message. Tweaked formatting of the
1679         dummy message.
1680
1681 2010-12-17  Sheriff Bot  <webkit.review.bot@gmail.com>
1682
1683         Unreviewed, rolling out r74201.
1684         http://trac.webkit.org/changeset/74201
1685         https://bugs.webkit.org/show_bug.cgi?id=51248
1686
1687         It broke ~6000 layout tests (Requested by Ossy_ on #webkit).
1688
1689         * UIProcess/API/qt/qgraphicswkview.cpp:
1690         (QGraphicsWKView::setGeometry):
1691         (QGraphicsWKView::itemChange):
1692
1693 2010-12-16  Sam Weinig  <sam@webkit.org>
1694
1695         Reviewed by Darin Adler.
1696
1697         Add svn:eol-style native to the message.in files as a favor to Darin Adler.
1698
1699         * PluginProcess/PluginControllerProxy.messages.in: Added property svn:eol-style.
1700         * PluginProcess/PluginProcess.messages.in: Added property svn:eol-style.
1701         * PluginProcess/WebProcessConnection.messages.in: Added property svn:eol-style.
1702         * Shared/Plugins/NPObjectMessageReceiver.messages.in: Added property svn:eol-style.
1703         * UIProcess/Downloads/DownloadProxy.messages.in: Added property svn:eol-style.
1704         * UIProcess/Plugins/PluginProcessProxy.messages.in: Added property svn:eol-style.
1705         * UIProcess/WebContext.messages.in: Added property svn:eol-style.
1706         * UIProcess/WebDatabaseManagerProxy.messages.in: Added property svn:eol-style.
1707         * UIProcess/WebInspectorProxy.messages.in: Added property svn:eol-style.
1708         * UIProcess/WebPageProxy.messages.in: Added property svn:eol-style.
1709         * UIProcess/WebProcessProxy.messages.in: Added property svn:eol-style.
1710         * WebProcess/Authentication/AuthenticationManager.messages.in: Added property svn:eol-style.
1711         * WebProcess/Plugins/PluginProxy.messages.in: Added property svn:eol-style.
1712         * WebProcess/WebCoreSupport/WebDatabaseManager.messages.in: Added property svn:eol-style.
1713         * WebProcess/WebPage/WebInspector.messages.in: Added property svn:eol-style.
1714         * WebProcess/WebPage/WebPage.messages.in: Added property svn:eol-style.
1715         * WebProcess/WebProcess.messages.in: Added property svn:eol-style.
1716
1717 2010-12-16  Sam Weinig  <sam@webkit.org>
1718
1719         Reviewed by Anders Carlsson.
1720
1721         Move NSURLCache initialization from the ProcessLauncherMac to the centralized
1722         WebContext initialize WebProcess mechanism.
1723
1724         * Shared/WebProcessCreationParameters.cpp:
1725         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
1726         (WebKit::WebProcessCreationParameters::encode):
1727         (WebKit::WebProcessCreationParameters::decode):
1728         * Shared/WebProcessCreationParameters.h:
1729         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1730         (WebKit::ProcessLauncher::launchProcess):
1731         * UIProcess/mac/WebContextMac.mm:
1732         (WebKit::WebContext::platformInitializeWebProcess):
1733         * WebProcess/WebProcess.cpp:
1734         (WebKit::WebProcess::initializeWebProcess):
1735         * WebProcess/mac/WebProcessMac.mm:
1736         (WebKit::WebProcess::platformInitializeWebProcess):
1737         * WebProcess/mac/WebProcessMainMac.mm:
1738         (WebKit::WebProcessMain):
1739         * WebProcess/win/WebProcessWin.cpp:
1740         (WebKit::WebProcess::platformInitializeWebProcess):
1741         (WebKit::WebProcess::setShouldPaintNativeControls):
1742
1743 2010-12-16  Anders Carlsson  <andersca@apple.com>
1744
1745         Reviewed by Dan Bernstein.
1746
1747         Defer getting a PluginProcessConnection object until the plug-in is initialized
1748         https://bugs.webkit.org/show_bug.cgi?id=51207
1749         <rdar://problem/8731306>
1750
1751         Before this change, we would pass the PluginProcessConnection to the PluginProxy constructor, but not
1752         call PluginProcessConnection::addPluginProxy (which associates the plug-in proxy with the connection)
1753         until the plug-in is initialized.
1754
1755         This could lead to a PluginProxy holding a reference to a PluginProcessConnection when the PluginProxyConnection
1756         itself did not know anything about the PluginProxy. This would happen when a page with plug-ins is opened in a background
1757         tab, with the plug-ins not yet initialized.
1758
1759         Because of this, we could end up in a weird state, where the PluginProcessConnection would think that there are no
1760         more plug-ins alive, and invalidate (and null out) the underlying CoreIPC connection, which would lead to crashes
1761         when trying to send messages to the connection during later initialization.
1762
1763         The fix is to pass the plug-in path to the PluginProxy constructor, and get the connection from PluginProxy::initialize.
1764         
1765         PluginProcessConnection object 
1766         * WebProcess/Plugins/PluginProxy.cpp:
1767         (WebKit::PluginProxy::create):
1768         (WebKit::PluginProxy::PluginProxy):
1769         (WebKit::PluginProxy::initialize):
1770         * WebProcess/Plugins/PluginProxy.h:
1771         * WebProcess/WebPage/WebPage.cpp:
1772         (WebKit::WebPage::createPlugin):
1773
1774 2010-12-16  Enrica Casucci  <enrica@apple.com>
1775
1776         Reviewed by Maciej Stachowiak.
1777
1778         WebKit2: Cannot copy two successive selections using cmd-c
1779         <rdar://problem/8680309> 
1780         https://bugs.webkit.org/show_bug.cgi?id=51203
1781         
1782         The previous implementation assumed a call sequence from AppKit that
1783         was not always happening.
1784         When the user clicks on the pulldown menu, AppKit sends validateUserInterfaceItem
1785         calls for each element that needs validation and we used to count the number of
1786         validation requests being sent to the web process.
1787         All these calls are made before we have the chance to get one reply from the WebProcess.
1788         We also delayed the menu update until we had received all the replies to the validation requests.
1789         At that point we called update on the menu to trigger the validation one more time with
1790         the data retrived from the WebProcess.
1791         When the user simply presses cmd-c, only one call to vaidateUserInterfaceItem is made
1792         and the menu update triggered the validation of all the menu entries causing the internal
1793         state to be out of sync.
1794         The new implementation is very simple: for each validation request from AppKit we send
1795         a request to the WebProcess and we cache a reference to the menu item being validated.
1796         When the WebProcess replies, we retrieve the menu item from our cache and update its state.
1797         
1798         * UIProcess/API/mac/WKView.mm:
1799         (-[WKView initWithFrame:contextRef:pageGroupRef:]): Removed initialization of deleted memebers.
1800         (-[WKView validateUserInterfaceItem:]): Request validation to the WebProcess and return YES to 
1801         allow AppKit to do the keyBinding processing.
1802         (-[WKView _setUserInterfaceItemState:enabled:state:]): Called when the WebProcess replies to the
1803         validation request to check/uncheck and enable/disable the menu item.
1804
1805 2010-12-16  Anders Carlsson  <andersca@apple.com>
1806
1807         Reviewed by Oliver Hunt.
1808
1809         Don't try to call plug-in member functions if the plug-in hasn't been initialized
1810         https://bugs.webkit.org/show_bug.cgi?id=51205
1811         <rdar://problem/8730204>
1812
1813         Make sure that all PluginView functions that can be called while a plug-in has not been
1814         initialized (if the plug-in page is in a background tab for example) have an additional
1815         check for m_isInitialized.
1816
1817         * WebProcess/Plugins/PluginView.cpp:
1818         (WebKit::PluginView::setWindowIsFocused):
1819         (WebKit::PluginView::windowAndViewFramesChanged):
1820         (WebKit::PluginView::platformLayer):
1821         (WebKit::PluginView::scriptObject):
1822         (WebKit::PluginView::privateBrowsingStateChanged):
1823         (WebKit::PluginView::handleEvent):
1824         (WebKit::PluginView::viewGeometryDidChange):
1825         (WebKit::PluginView::setFocus):
1826
1827 2010-12-16  Anders Carlsson  <andersca@apple.com>
1828
1829         Reviewed by John Sullivan.
1830
1831         Add a bunch of m_isStarted assertions to plug-in code.
1832
1833         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1834         (WebKit::NetscapePlugin::frameDidFinishLoading):
1835         (WebKit::NetscapePlugin::frameDidFail):
1836         (WebKit::NetscapePlugin::didEvaluateJavaScript):
1837         (WebKit::NetscapePlugin::streamDidReceiveResponse):
1838         (WebKit::NetscapePlugin::streamDidReceiveData):
1839         (WebKit::NetscapePlugin::streamDidFinishLoading):
1840         (WebKit::NetscapePlugin::streamDidFail):
1841         (WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
1842         (WebKit::NetscapePlugin::manualStreamDidReceiveData):
1843         (WebKit::NetscapePlugin::manualStreamDidFinishLoading):
1844         (WebKit::NetscapePlugin::manualStreamDidFail):
1845         (WebKit::NetscapePlugin::handleMouseEvent):
1846         (WebKit::NetscapePlugin::handleWheelEvent):
1847         (WebKit::NetscapePlugin::handleMouseEnterEvent):
1848         (WebKit::NetscapePlugin::handleMouseLeaveEvent):
1849         (WebKit::NetscapePlugin::handleKeyboardEvent):
1850         (WebKit::NetscapePlugin::setFocus):
1851         (WebKit::NetscapePlugin::pluginScriptableNPObject):
1852         (WebKit::NetscapePlugin::privateBrowsingStateChanged):
1853
1854 2010-12-16  Anders Carlsson  <andersca@apple.com>
1855
1856         Reviewed by Darin Adler.
1857
1858         Save the manual plug-in stream data and redeliver it when the plug-in is initialized
1859         https://bugs.webkit.org/show_bug.cgi?id=51201
1860
1861         * WebProcess/Plugins/PluginView.cpp:
1862         (WebKit::PluginView::PluginView):
1863         Initialize m_manualStreamState.
1864
1865         (WebKit::PluginView::manualLoadDidReceiveResponse):
1866         If the plug-in hasn't been initialized, store the response.
1867
1868         (WebKit::PluginView::manualLoadDidReceiveData):
1869         If the plug-in hasn't been initialized, store the data.
1870         
1871         (WebKit::PluginView::manualLoadDidFinishLoading):
1872         If the plug-in hasn't been initialized, update the state.
1873
1874         (WebKit::PluginView::manualLoadDidFail):
1875         If the plug-in hasn't been initialized, store the error and update the state.
1876         
1877         (WebKit::PluginView::initializePlugin):
1878         Call redeliverManualStream.
1879
1880         (WebKit::PluginView::redeliverManualStream):
1881         Redeliver the manual stream to the plug-in.
1882
1883         * WebProcess/Plugins/PluginView.h:
1884
1885 2010-12-16  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
1886
1887         Reviewed by Andreas Kling.
1888
1889         [Qt] Turn off drawing area updates if the item is not visible
1890
1891         The updates are controlled by the QGraphicsItem::visible property.
1892
1893         * UIProcess/API/qt/qgraphicswkview.cpp:
1894         (QGraphicsWKViewPrivate::updateViewportSize):
1895         (QGraphicsWKView::setGeometry):
1896         (QGraphicsWKView::itemChange):
1897
1898 2010-12-15  Dan Bernstein  <mitz@apple.com>
1899
1900         Reviewed by Sam Weinig.
1901
1902         <rdar://problem/8731320> WebProcess’s CFNetwork cache is in ~/Library/Caches/com.apple.WebProcess
1903
1904         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1905         (WebKit::ProcessLauncher::launchProcess): Get the location, disk capacity and memory capacity
1906         of the UI process’s NSURLCache and pass them to the WebProcess.
1907         * WebProcess/mac/WebProcessMainMac.mm:
1908         (WebKit::WebProcessMain): If an NSURLCache location was passed on the command line, set the
1909         shared NSURLCache to that path and use the specified capacities as initial values.
1910
1911 2010-12-15  Dan Bernstein  <mitz@apple.com>
1912
1913         Reviewed by Sam “I blame andersca” Weinig.
1914
1915         Allow responses to be cached by the NSURLCache.
1916
1917         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1918         (WebKit::WebFrameLoaderClient::willCacheResponse): Changed to return the response instead of 0.
1919
1920 2010-12-14  Enrica Casucci  <enrica@apple.com>
1921
1922         Reviewed by Adam Roben.
1923
1924         Add IME support to WebKit2 on Windows
1925         https://bugs.webkit.org/show_bug.cgi?id=51049
1926         The implementation is very close to the one in WebKit.
1927         The main change is the addition of handlers for WM_IME_STARTCOMPOSITION,
1928         WM_IME_REQUEST, WM_IME_COMPOSITION, WM_IME_ENDCOMPOSITION,
1929         WM_IME_SELECT, WM_IME_SETCONTEXT and a number of new messages
1930         between the UI process and the WebProcess to send/retrieve
1931         the data being handled by the messages listed above.
1932
1933         * UIProcess/PageClient.h: Added compositionSelectionChanged for Windows platform.
1934         * UIProcess/WebPageProxy.cpp:
1935         The following methods send synchronous messages to the WebProcess.
1936         (WebKit::WebPageProxy::firstRectForCharacterInSelectedRange): Retrieves the rectangle to position
1937         the cnadidates window.
1938         (WebKit::WebPageProxy::getSelectedText): Retrieves the currently selected text.
1939         The following methods send asynchronous messages to the WebProcess.
1940         (WebKit::WebPageProxy::confirmComposition):
1941         (WebKit::WebPageProxy::setComposition):
1942         (WebKit::WebPageProxy::didChangeSelection): Name changed.
1943         (WebKit::WebPageProxy::didChangeCompositionSelection): Called when there is a change
1944         in the composition selection.
1945         * UIProcess/WebPageProxy.messages.in: Added messages corresponding to the methods above.
1946         * UIProcess/win/WebView.cpp:
1947         (WebKit::WebView::wndProc): Added handling of messages for IME.
1948         The following are the handlers for the window message being sent during composition.
1949         (WebKit::WebView::onIMEComposition):
1950         (WebKit::WebView::onIMEEndComposition):
1951         (WebKit::WebView::onIMERequestCharPosition):
1952         (WebKit::WebView::onIMERequestReconvertString):
1953         (WebKit::WebView::onIMERequest):
1954         (WebKit::WebView::onIMESelect):
1955         (WebKit::WebView::onIMESetContext):
1956         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1957         (WebKit::WebEditorClient::respondToChangedSelection): Added notification
1958         of composition selection changed for Windows.
1959         * WebProcess/WebPage/win/WebPageWin.cpp:
1960         The following are the WebProcess counterparts of the new messages.
1961         (WebKit::WebPage::confirmComposition):
1962         (WebKit::WebPage::setComposition):
1963         (WebKit::WebPage::firstRectForCharacterInSelectedRange):
1964         (WebKit::WebPage::getSelectedText):
1965
1966 2010-12-15  Sam Weinig  <sam@webkit.org>
1967
1968         Reviewed by Brady Eidson.
1969
1970         Loading webkit.org over and over is slower in WebKit2 than WebKit1, looks like page is not cached
1971         <rdar://problem/8774683>
1972         https://bugs.webkit.org/show_bug.cgi?id=51143
1973
1974         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1975         (WebKit::WebFrameLoaderClient::canCachePage): Return true as long as we
1976         are not a custom representation (eg. a PDF).
1977         (WebKit::WebFrameLoaderClient::shouldCacheResponse): Always return true.
1978         * WebProcess/WebPage/WebPage.cpp:
1979         (WebKit::WebPage::updatePreferences): Enable the page cache.
1980
1981 2010-12-15  Simon Fraser  <simon.fraser@apple.com>
1982
1983         Reviewed by Adele Peterson.
1984
1985         WebKit2 in compositing mode no longer has font smoothing
1986         https://bugs.webkit.org/show_bug.cgi?id=50733
1987         
1988         Tell the root GraphicsLayer that its contents are opaque
1989         if the WebPage draws its background, and that background
1990         is not transparent.
1991         
1992         The GraphicsLayer then uses the 'contentsOpaque' setting to
1993         determine whether to use font smoothing.
1994         
1995         Add pageBackgroundTransparencyChanged() to DrawingArea
1996         so that the WebPage can inform the DrawingArea when the
1997         background transparency changes.
1998
1999         * WebProcess/WebPage/DrawingArea.h:
2000         (WebKit::DrawingArea::pageBackgroundTransparencyChanged):
2001         (WebKit::DrawingArea::onPageClose):
2002         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
2003         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
2004         (WebKit::LayerBackedDrawingArea::pageBackgroundTransparencyChanged):
2005         * WebProcess/WebPage/LayerBackedDrawingArea.h:
2006         * WebProcess/WebPage/WebPage.cpp:
2007         (WebKit::WebPage::setDrawsBackground):
2008         (WebKit::WebPage::setDrawsTransparentBackground):
2009
2010 2010-12-15  Anders Carlsson  <andersca@apple.com>
2011
2012         Reviewed by Sam Weinig.
2013
2014         Fix assertion in plugins/return-error-from-new-stream-callback-in-full-frame-plugin.html test
2015         https://bugs.webkit.org/show_bug.cgi?id=51136
2016
2017         Ensure that a plug-in that has explicitly cancelled the manual stream won't get any more callbacks.
2018
2019         * PluginProcess/PluginControllerProxy.cpp:
2020         (WebKit::PluginControllerProxy::PluginControllerProxy):
2021         (WebKit::PluginControllerProxy::cancelManualStreamLoad):
2022         (WebKit::PluginControllerProxy::manualStreamDidReceiveResponse):
2023         (WebKit::PluginControllerProxy::manualStreamDidReceiveData):
2024         (WebKit::PluginControllerProxy::manualStreamDidFinishLoading):
2025         (WebKit::PluginControllerProxy::manualStreamDidFail):
2026         * PluginProcess/PluginControllerProxy.h:
2027
2028 2010-12-15  Brian Weinstein  <bweinstein@apple.com>
2029
2030         Windows Build Fix. A .h file was added to the vcproj twice, but not its corresponding cpp file.
2031
2032         * win/WebKit2.vcproj:
2033
2034 2010-12-15  Sam Weinig  <sam@webkit.org>
2035
2036         Reviewed by Anders Carlsson.
2037
2038         WebKit2: Can't add files to an <input type=file>
2039         https://bugs.webkit.org/show_bug.cgi?id=51087
2040
2041         * Scripts/webkit2/messages.py:
2042         Adds new types.
2043
2044         * Shared/API/c/WKBase.h:
2045         Adds WKOpenPanelParametersRef and WKOpenPanelResultListenerRef.
2046
2047         * Shared/APIObject.h:
2048         Adds TypeOpenPanelParameters and TypeOpenPanelResultListener.
2049
2050         * Shared/WebOpenPanelParameters.cpp: Added.
2051         (WebKit::WebOpenPanelParameters::create):
2052         (WebKit::WebOpenPanelParameters::WebOpenPanelParameters):
2053         (WebKit::WebOpenPanelParameters::~WebOpenPanelParameters):
2054         (WebKit::WebOpenPanelParameters::Data::encode):
2055         (WebKit::WebOpenPanelParameters::Data::decode):
2056         * Shared/WebOpenPanelParameters.h: Added.
2057         (WebKit::WebOpenPanelParameters::allowMultipleFiles):
2058         (WebKit::WebOpenPanelParameters::type):
2059         Class representing options one can pass to open panel.
2060
2061         * UIProcess/API/C/WKAPICast.h:
2062         Add casts for WebOpenPanelParameters and WebOpenPanelResultListenerProxy.
2063
2064         * UIProcess/API/C/WKOpenPanelParameters.cpp: Added.
2065         (WKOpenPanelParametersGetTypeID):
2066         (WKOpenPanelParametersGetAllowsMultipleFiles):
2067         * UIProcess/API/C/WKOpenPanelParameters.h: Added.
2068         * UIProcess/API/C/WKOpenPanelResultListener.cpp: Added.
2069         (WKOpenPanelResultListenerGetTypeID):
2070         (WKOpenPanelResultListenerChooseFiles):
2071         (WKOpenPanelResultListenerCancel):
2072         * UIProcess/API/C/WKOpenPanelResultListener.h: Added.
2073         Add API wrappers.
2074
2075         * UIProcess/API/C/WKPage.h:
2076         Add new UI callback, WKPageRunOpenPanelCallback.
2077
2078         * UIProcess/API/C/WebKit2.h:
2079         Add includes for new API headers.
2080
2081         * UIProcess/API/qt/qwkpage.cpp:
2082         (QWKPage::QWKPage):
2083         Stub out the runOpenPanel callback.
2084
2085         * UIProcess/WebOpenPanelResultListenerProxy.cpp: Added.
2086         (WebKit::WebOpenPanelResultListenerProxy::WebOpenPanelResultListenerProxy):
2087         (WebKit::WebOpenPanelResultListenerProxy::~WebOpenPanelResultListenerProxy):
2088         (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
2089         (WebKit::WebOpenPanelResultListenerProxy::cancel):
2090         (WebKit::WebOpenPanelResultListenerProxy::invalidate):
2091         * UIProcess/WebOpenPanelResultListenerProxy.h: Added.
2092         (WebKit::WebOpenPanelResultListenerProxy::create):
2093         (WebKit::WebOpenPanelResultListenerProxy::type):
2094         Adds the listener used to choose files for <input type=file>
2095
2096         * UIProcess/WebPageProxy.cpp:
2097         (WebKit::WebPageProxy::runOpenPanel):
2098         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
2099         (WebKit::WebPageProxy::didCancelForOpenPanel):
2100         * UIProcess/WebPageProxy.h:
2101         * UIProcess/WebPageProxy.messages.in:
2102         * UIProcess/WebUIClient.cpp:
2103         (WebKit::WebUIClient::runOpenPanel):
2104         * UIProcess/WebUIClient.h:
2105         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2106         (WebKit::WebChromeClient::runOpenPanel):
2107         * WebProcess/WebPage/WebOpenPanelResultListener.cpp: Added.
2108         (WebKit::WebOpenPanelResultListener::create):
2109         (WebKit::WebOpenPanelResultListener::WebOpenPanelResultListener):
2110         (WebKit::WebOpenPanelResultListener::~WebOpenPanelResultListener):
2111         (WebKit::WebOpenPanelResultListener::didChooseFiles):
2112         * WebProcess/WebPage/WebOpenPanelResultListener.h: Added.
2113         (WebKit::WebOpenPanelResultListener::disconnectFromPage):
2114         * WebProcess/WebPage/WebPage.cpp:
2115         (WebKit::WebPage::close):
2116         (WebKit::WebPage::setActiveOpenPanelResultListener):
2117         (WebKit::WebPage::didChooseFilesForOpenPanel):
2118         (WebKit::WebPage::didCancelForOpenPanel):
2119         * WebProcess/WebPage/WebPage.h:
2120         (WebKit::WebPage::activeOpenPanelResultListener):
2121         * WebProcess/WebPage/WebPage.messages.in:
2122         Pipe through file choosing.
2123
2124         * WebKit2.pro:
2125         * WebKit2.xcodeproj/project.pbxproj:
2126         * win/WebKit2.vcproj:
2127         * win/WebKit2Generated.make:
2128         Add new files.
2129
2130 2010-12-15  Anders Carlsson  <andersca@apple.com>
2131
2132         Reviewed by Maciej Stachowiak.
2133
2134         Semi-reproducible crash in ChunkedUpdateDrawingArea::paintIntoUpdateChunk closing a particular yahoo page
2135         https://bugs.webkit.org/show_bug.cgi?id=51126
2136         <rdar://problem/8771219>
2137
2138         Laying out the web page can cause the drawing area to change so we need to protect against this.
2139
2140         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
2141         (WebKit::ChunkedUpdateDrawingArea::display):
2142         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
2143         (WebKit::LayerBackedDrawingArea::display):
2144         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
2145         (WebKit::LayerBackedDrawingArea::updateLayoutRunLoopObserverFired):
2146
2147 2010-12-15  Brian Weinstein  <bweinstein@apple.com>
2148
2149         Reviewed by Adam Roben.
2150
2151         WebKit2: WebPageWin needs implementations of hasLocalDataForURL and canHandleRequest
2152         https://bugs.webkit.org/show_bug.cgi?id=51090
2153         
2154         Implement these functions for WebKit2 on Windows.
2155
2156         * WebProcess/WebPage/WebPage.cpp:
2157         (WebKit::WebPage::hasLocalDataForURL): Does the cross-platform part of the check for having local
2158             data (file URL or subresource), then calls platformHasLocalDataForURL to let the platform do
2159             their specific checks.
2160         * WebProcess/WebPage/WebPage.h:
2161         * WebProcess/WebPage/mac/WebPageMac.mm:
2162         (WebKit::WebPage::platformHasLocalDataForURL): Moved the cross-platform code from here to WebPage::hasLocalDataForURL.
2163         * WebProcess/WebPage/qt/WebPageQt.cpp:
2164         (WebKit::WebPage::platformHasLocalDataForURL): Renamed from hasLocalDataForURL.
2165         * WebProcess/WebPage/win/WebPageWin.cpp:
2166         (WebKit::WebPage::platformHasLocalDataForURL): Renamed from hasLocalDataForURL and implemented with CFNetwork calls. This is the
2167             CFNetwork equivalent of the code in WebPageMac::platformHasLocalDataForURL.
2168         (WebKit::WebPage::canHandleRequest): Copied the line of code from WebView::canHandleRequest in WebKit1, with a FIXME saying
2169             this might not be enough (although it was in WebKit1 on Windows).
2170
2171 2010-12-15  Sheriff Bot  <webkit.review.bot@gmail.com>
2172
2173         Unreviewed, rolling out r74117.
2174         http://trac.webkit.org/changeset/74117
2175         https://bugs.webkit.org/show_bug.cgi?id=51113
2176
2177         This broke the GTK1 build. (Requested by mrobinson on
2178         #webkit).
2179
2180         * GNUmakefile.am: Removed.
2181         * Scripts/generate-forwarding-headers.pl:
2182         * WebKit2Prefix.h:
2183         * gtk/webkit2.pc.in: Removed.
2184
2185 2010-12-15  Amruth Raj  <amruthraj@motorola.com> and Ravi Kasibhatla  <ravi.kasibhatla@motorola.com>
2186
2187         Reviewed by Martin Robinson.
2188
2189         Changes to enable building WebKit2 for Gtk port.
2190         (https://bugs.webkit.org/show_bug.cgi?id=37369)
2191
2192         * GNUmakefile.am: Added. 
2193         * Scripts/generate-forwarding-headers.pl: For GTK port, taking 1 extra argument for copying network headers.
2194         * WebKit2Prefix.h: Included WebCore/config.h for GTK port as the first header file for WebKit2 sources files.
2195         * gtk: Added.
2196         * gtk/webkit2.pc.in: Added.
2197
2198 2010-12-15  Jan Erik Hanssen  <jhanssen@sencha.com>
2199
2200         Reviewed by Andreas Kling.
2201
2202         [Qt][WK2] webkit2 does not compile on OS X
2203         https://bugs.webkit.org/show_bug.cgi?id=50128
2204
2205         prctl(2) is only available on Linux, so use an atexit handler for killing
2206         all the child processes when the process is exiting.
2207
2208         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
2209         (WebKit::cleanupProcesses):
2210         (WebKit::QtWebProcess::QtWebProcess):
2211         (WebKit::QtWebProcess::processStateChanged):
2212         (WebKit::ProcessLauncherHelper::instance):
2213
2214 2010-12-14  Anders Carlsson  <andersca@apple.com>
2215
2216         Fix Windows build.
2217
2218         * win/WebKit2Common.vsprops:
2219
2220 2010-12-14  Anders Carlsson  <andersca@apple.com>
2221
2222         Fix Qt build.
2223
2224         * WebKit2.pro:
2225
2226 2010-12-14  Anders Carlsson  <andersca@apple.com>
2227
2228         Reviewed by TYPO FIX.
2229
2230         Fix a typo.
2231
2232         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2233         (WebKit::NetscapePluginModule::determineQuirks):
2234
2235 2010-12-14  Anders Carlsson  <andersca@apple.com>
2236
2237         Reviewed by Sam Weinig.
2238
2239         Cannot type into plugin edit field
2240         https://bugs.webkit.org/show_bug.cgi?id=51074
2241         <rdar://problem/8483741>
2242
2243         Add a PrognameShouldBeWebKitPluginHost quirk, since it turns out Flash Player calls getprogname() and checks
2244         if the return value is "WebKitPluginHost" in order to determine when to handle NPCocoaEventKeyDown events.
2245
2246         * PluginProcess/PluginProcess.cpp:
2247         (WebKit::PluginProcess::netscapePluginModule):
2248         If the plug-in module has the PrognameShouldBeWebKitPluginHost quirk, call setprogname("WebKitPluginHost").
2249         
2250         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2251         (WebKit::NetscapePluginModule::load):
2252         Call determineQuirks()
2253
2254         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2255         (WebKit::NetscapePluginModule::determineQuirks):
2256         Add the PrognameShouldBeWebKitPluginHost quirk for Flash.
2257         
2258         * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp:
2259         (WebKit::NetscapePluginModule::determineQuirks):
2260         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
2261         (WebKit::NetscapePluginModule::determineQuirks):
2262         Add stubs.
2263
2264         * Shared/Plugins/PluginQuirks.h:
2265         Add new PluginQuirks file.
2266
2267         * WebKit2.xcodeproj/project.pbxproj:
2268         Add PluginQuirks.h
2269
2270 2010-12-14  Anders Carlsson  <andersca@apple.com>
2271
2272         Reviewed by Sam Weinig.
2273
2274         Add a NetscapePluginModuleX11 and move the Qt implementation of PluginInfoStore::getPluginInfo there
2275         https://bugs.webkit.org/show_bug.cgi?id=51066
2276
2277         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: Copied from WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp.
2278         (WebKit::NetscapePluginModule::getPluginInfo):
2279         * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp:
2280         (WebKit::PluginInfoStore::getPluginInfo):
2281         * WebKit2.pro:
2282
2283 2010-12-14  Anders Carlsson  <andersca@apple.com>
2284
2285         Reviewed by Dan Bernstein.
2286
2287         Move Windows version of getPluginInfo to NetscapePluginModule
2288         https://bugs.webkit.org/show_bug.cgi?id=51073
2289
2290         * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp: Added.
2291         (WebKit::getVersionInfo):
2292         (WebKit::fileVersion):
2293         (WebKit::NetscapePluginModule::getPluginInfo):
2294         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
2295         (WebKit::PluginInfoStore::getPluginInfo):
2296         * win/WebKit2.vcproj:
2297
2298 2010-12-14  Alice Liu  <alice.liu@apple.com>
2299
2300         Fix clang++ build.
2301
2302         * UIProcess/WebProcessProxy.h:
2303         (WebKit::WebProcessProxy::sendSync):
2304         Move the default argument to the declaration.
2305
2306 2010-12-14  Anders Carlsson  <andersca@apple.com>
2307
2308         Reviewed by Adam Roben.
2309
2310         Move PluginInfoStore::getPluginInfo to NetscapePluginModule
2311         https://bugs.webkit.org/show_bug.cgi?id=51058
2312
2313         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2314         Move implementation of PluginInfoStore::getPluginInfo and related
2315         helper functions here.
2316
2317         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2318         (WebKit::PluginInfoStore::getPluginInfo):
2319         Just call NetscapePluginModule::getPluginInfo here for now.
2320
2321         * WebKit2.xcodeproj/project.pbxproj:
2322         Add NetscapePluginModuleMac.mm.
2323
2324 2010-12-14  Anders Carlsson  <andersca@apple.com>
2325
2326         Reviewed by John Sullivan.
2327
2328         Switch name and description order when fetching Carbon plug-in info
2329         https://bugs.webkit.org/show_bug.cgi?id=46211
2330
2331         The plug-in description comes before the name in the Carbon string list resource.
2332
2333         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2334         (WebKit::getPluginInfoFromCarbonResources):
2335
2336 2010-12-14  Anders Carlsson  <andersca@apple.com>
2337
2338         Reviewed by Adam Roben.
2339
2340         Move NetscapePluginModule.{cpp|h} to Shared/Plugins/Netscape
2341         https://bugs.webkit.org/show_bug.cgi?id=51052
2342
2343         * Shared/Plugins/Netscape/NetscapePluginModule.cpp: Renamed from WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.cpp.
2344         * Shared/Plugins/Netscape/NetscapePluginModule.h: Renamed from WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.h.
2345         * WebKit2.pro:
2346         * WebKit2.xcodeproj/project.pbxproj:
2347         * win/WebKit2.vcproj:
2348         * win/WebKit2Common.vsprops:
2349
2350 2010-12-14  Anders Carlsson  <andersca@apple.com>
2351
2352         Reviewed by Sam Weinig.
2353
2354         Handle complex text input for plug-ins
2355         https://bugs.webkit.org/show_bug.cgi?id=51047
2356
2357         * PluginProcess/PluginControllerProxy.cpp:
2358         (WebKit::PluginControllerProxy::sendComplexTextInput):
2359         Pass along the text input to the plug-in.
2360
2361         * PluginProcess/PluginControllerProxy.messages.in:
2362         Add SendComplexTextInput message.
2363
2364         * UIProcess/API/mac/WKTextInputWindowController.h: Added.
2365         * UIProcess/API/mac/WKTextInputWindowController.mm: Added.
2366         Add text input window controller, mostly copied from WebKit1.
2367         
2368         * UIProcess/API/mac/WKView.mm:
2369         (-[WKView keyDown:]):
2370         If needed, pass along the event to the text input window controller.
2371
2372         (-[WKView inputContext]):
2373         Return the input context of the text input window controller.
2374
2375         (-[WKView _setComplexTextInputEnabled:pluginComplexTextInputIdentifier:]):
2376         Notify the input window controller that the input source changed.
2377
2378         * UIProcess/WebPageProxy.cpp:
2379         (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
2380         Send the complex text input to the web process.
2381
2382         * WebKit2.xcodeproj/project.pbxproj:
2383         Add new files.
2384
2385         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2386         (WebKit::convertStringToKeyCodes):
2387         Convert a string to a vector of key codes in the current encoding.
2388
2389         (WebKit::NetscapePlugin::sendComplexTextInput):
2390         In the Cocoa event model, create and dispatch an NPCocoaEventTextInput event.
2391         In the Carbon event model, convert the string to individual key codes and send them
2392         as key down events.
2393
2394         * WebProcess/Plugins/PluginProxy.cpp:
2395         (WebKit::PluginProxy::sendComplexTextInput):
2396         Send the text to the plug-in controller proxy.
2397
2398         * WebProcess/Plugins/PluginView.cpp:
2399         (WebKit::PluginView::sendComplexTextInput):
2400         If the plug-in has a matching text input identifier, call Plugin::sendComplexTextInput.
2401
2402         * WebProcess/WebPage/WebPage.messages.in:
2403         Add SendComplexTextInputToPlugin message.
2404
2405         * WebProcess/WebPage/mac/WebPageMac.mm:
2406         (WebKit::WebPage::sendComplexTextInputToPlugin):
2407         Iterate over all known plug-in views and try to find one to send the text input to.
2408
2409 2010-12-13  Alexey Proskuryakov  <ap@apple.com>
2410
2411         Reviewed by Adam Barth.
2412
2413         https://bugs.webkit.org/show_bug.cgi?id=50953
2414         DNS Prefetch should be an opt-in feature
2415
2416         Pass the preference through WebKit2.
2417
2418         * Shared/WebPreferencesStore.h:
2419         * UIProcess/API/C/WKPreferences.cpp:
2420         (WKPreferencesSetDNSPrefetchingEnabled):
2421         (WKPreferencesGetDNSPrefetchingEnabled):
2422         * UIProcess/API/C/WKPreferences.h:
2423         * WebProcess/WebPage/WebPage.cpp:
2424         (WebKit::WebPage::updatePreferences):
2425
2426 2010-12-13  Anders Carlsson  <andersca@apple.com>
2427
2428         Reviewed by Kevin Decker.
2429
2430         Pass the complex text input status to the WKView
2431         https://bugs.webkit.org/show_bug.cgi?id=50993
2432
2433         * UIProcess/API/mac/PageClientImpl.h:
2434         * UIProcess/API/mac/PageClientImpl.mm:
2435         (WebKit::PageClientImpl::setComplexTextInputEnabled):
2436         * UIProcess/API/mac/WKView.mm:
2437         (-[WKView _setComplexTextInputEnabled:pluginComplexTextInputIdentifier:]):
2438         * UIProcess/API/mac/WKViewInternal.h:
2439         * UIProcess/PageClient.h:
2440         * UIProcess/WebPageProxy.cpp:
2441         (WebKit::WebPageProxy::setComplexTextInputEnabled):
2442
2443 2010-12-14  Benjamin Poulain  <benjamin.poulain@nokia.com>
2444
2445         Reviewed by Kenneth Rohde Christiansen.
2446
2447         WebKit 2 does not send touch cancel events correctly between processes
2448         https://bugs.webkit.org/show_bug.cgi?id=50235
2449
2450         The classes WebKit2PlatformTouchPoint and WebKit2PlatformTouchEvent
2451         misses the conversion of TouchCancel events and points.
2452
2453         This patch add the missing enums when converting from a WebTouchEvent
2454         to a PlatformTouchEvent.
2455
2456         Testing is already covered by fast/events/touch/send-oncancel-event.html
2457
2458         * Shared/WebEventConversion.cpp:
2459         (WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint):
2460         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
2461
2462 2010-12-14  Zalan Bujtas  <zbujtas@gmail.com>
2463
2464         Reviewed by Kenneth Rohde Christiansen.
2465
2466         Add loadFinished() for provisional load error
2467         This fixes the hanging UI state, when provisional load error occurs due to
2468         the async nature of policy check.
2469
2470         https://bugs.webkit.org/show_bug.cgi?id=48724
2471
2472         * UIProcess/API/qt/ClientImpl.cpp:
2473         (loadFinished):
2474         (qt_wk_didFailProvisionalLoadWithErrorForFrame):
2475         (qt_wk_didFinishLoadForFrame):
2476         (qt_wk_didFailLoadWithErrorForFrame):
2477
2478 2010-12-13  Sam Weinig  <sam@webkit.org>
2479
2480         Reviewed by Anders Carlsson.
2481
2482         WebKit2: Need to be able to set the application name for the user agent for a WKPage
2483         https://bugs.webkit.org/show_bug.cgi?id=51011
2484
2485         Fixes:
2486             WebKit2: Need to be able to set the application name for the user agent for a WKPage
2487             <rdar://problem/8564532>
2488             WebKit2: Need to be able to get the computed user agent for a WKPage
2489             <rdar://problem/8637285>
2490
2491         Moves user agent computation to the UIProcess and just passes it to the WebProcess
2492         when it has changed.
2493
2494         * Shared/WebPageCreationParameters.cpp:
2495         (WebKit::WebPageCreationParameters::encode):
2496         (WebKit::WebPageCreationParameters::decode):
2497         * Shared/WebPageCreationParameters.h:
2498         Add a user agent to the creation parameters.
2499
2500         * UIProcess/API/C/WKPage.cpp:
2501         (WKPageCopyUserAgent):
2502         (WKPageCopyApplicationNameForUserAgent):
2503         (WKPageSetApplicationNameForUserAgent):
2504         (WKPageSetCustomUserAgent):
2505         * UIProcess/API/C/WKPage.h:
2506         Add new API to set the application name and access the computed user agent.
2507
2508         * UIProcess/WebPageProxy.cpp:
2509         (WebKit::WebPageProxy::WebPageProxy):
2510         (WebKit::WebPageProxy::close):
2511         (WebKit::WebPageProxy::setUserAgent):
2512         (WebKit::WebPageProxy::setApplicationNameForUserAgent):
2513         (WebKit::WebPageProxy::setCustomUserAgent):
2514         (WebKit::WebPageProxy::processDidCrash):
2515         (WebKit::WebPageProxy::creationParameters):
2516         * UIProcess/WebPageProxy.h:
2517         (WebKit::WebPageProxy::userAgent):
2518         (WebKit::WebPageProxy::applicationNameForUserAgent):
2519         * UIProcess/mac/WebPageProxyMac.mm: Added.
2520         * WebProcess/WebPage/WebPage.cpp:
2521         (WebKit::WebPage::WebPage):
2522         (WebKit::WebPage::setUserAgent):
2523         * WebProcess/WebPage/WebPage.h:
2524         (WebKit::WebPage::userAgent):
2525         * WebProcess/WebPage/WebPage.messages.in:
2526         Pipe through user agent.
2527
2528         (WebKit::callGestalt):
2529         (WebKit::macOSXVersionString):
2530         (WebKit::userVisibleWebKitVersionString):
2531         (WebKit::WebPageProxy::standardUserAgent):
2532         * UIProcess/win/WebPageProxyWin.cpp: Added.
2533         (WebKit::windowsVersion):
2534         (WebKit::userVisibleWebKitVersionString):
2535         (WebKit::WebPageProxy::standardUserAgent):
2536         Port standardUserAgent computation from WebKit1.
2537
2538         * UIProcess/qt/WebPageProxyQt.cpp: Added.
2539         (WebKit::WebPageProxy::standardUserAgent):
2540         Stub out the user agent so there is no change in behavior.
2541
2542         * WebKit2.pro:
2543         * WebKit2.xcodeproj/project.pbxproj:
2544         * win/WebKit2.vcproj:
2545         Add new file.
2546
2547 2010-12-13  Brady Eidson  <beidson@apple.com>
2548
2549         Reviewed by Jon Honeycutt (and Brian Weinstein in heart).
2550
2551         <rdar://problem/8752202> and https://bugs.webkit.org/show_bug.cgi?id=50997
2552         Expose "link title" and "link label" to InjectedBundleHitTestResult API
2553
2554         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
2555         (WKBundleHitTestResultCopyLinkLabel):
2556         (WKBundleHitTestResultCopyLinkTitle):
2557         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
2558
2559         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
2560         (WebKit::InjectedBundleHitTestResult::linkLabel):
2561         (WebKit::InjectedBundleHitTestResult::linkTitle):
2562         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
2563
2564 2010-12-13  Brian Weinstein  <bweinstein@apple.com>
2565
2566         Windows Build Fix. Add a needed include.
2567
2568         * UIProcess/win/WebView.cpp:
2569
2570 2010-12-13  Sam Weinig  <sam@webkit.org>
2571
2572         Reviewed by Anders Carlsson.
2573
2574         Remove associated page concept from WKView constructor
2575         https://bugs.webkit.org/show_bug.cgi?id=50983
2576
2577         Step 2: Remove WebPageNamespace.  It no longer does anything.
2578
2579         * Shared/APIObject.h:
2580         * UIProcess/API/C/WKPage.h:
2581         * UIProcess/API/mac/WKView.mm:
2582         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
2583         * UIProcess/API/qt/qgraphicswkview.cpp:
2584         * UIProcess/API/qt/qwkcontext.cpp:
2585         (QWKContext::QWKContext):
2586         * UIProcess/API/qt/qwkcontext_p.h:
2587         * UIProcess/API/qt/qwkpage.cpp:
2588         (QWKPagePrivate::QWKPagePrivate):
2589         * UIProcess/API/qt/qwkpage_p.h:
2590         * UIProcess/WebContext.cpp:
2591         (WebKit::WebContext::WebContext):
2592         (WebKit::WebContext::~WebContext):
2593         (WebKit::WebContext::createWebPage):
2594         * UIProcess/WebContext.h:
2595         * UIProcess/WebPageNamespace.cpp: Removed.
2596         * UIProcess/WebPageNamespace.h: Removed.
2597         * UIProcess/WebPageProxy.cpp:
2598         * UIProcess/WebPageProxy.h:
2599         (WebKit::WebPageProxy::context):
2600         * UIProcess/WebProcessProxy.cpp:
2601         (WebKit::WebProcessProxy::createWebPage):
2602         * UIProcess/WebProcessProxy.h:
2603         * UIProcess/win/WebView.cpp:
2604         (WebKit::WebView::WebView):
2605         * UIProcess/win/WebView.h:
2606         * WebKit2.pro:
2607         * WebKit2.xcodeproj/project.pbxproj:
2608         * win/WebKit2.vcproj:
2609
2610 2010-12-13  Sam Weinig  <sam@webkit.org>
2611
2612         Fix windows build.
2613
2614         * UIProcess/win/WebView.h:
2615
2616 2010-12-13  Sam Weinig  <sam@webkit.org>
2617
2618         Fix windows build.
2619
2620         * UIProcess/win/WebInspectorProxyWin.cpp:
2621         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2622         * UIProcess/win/WebView.h:
2623         (WebKit::WebView::create):
2624
2625 2010-12-13  Sam Weinig  <sam@webkit.org>
2626
2627         Reviewed by Anders Carlsson.
2628
2629         Remove associated page concept from WKView constructor
2630         https://bugs.webkit.org/show_bug.cgi?id=50983
2631
2632         Step 1: Remove associate page constructors from WKView and make
2633         all views use the shared namespace for the context.
2634
2635         * UIProcess/API/C/win/WKView.cpp:
2636         * UIProcess/API/C/win/WKView.h:
2637         * UIProcess/API/mac/WKView.h:
2638         * UIProcess/API/mac/WKView.mm:
2639         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
2640         * UIProcess/API/qt/qwkcontext.cpp:
2641         * UIProcess/API/qt/qwkcontext.h:
2642         * UIProcess/mac/WebInspectorProxyMac.mm:
2643         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2644         * UIProcess/win/WebView.cpp:
2645         (WebKit::WebView::WebView):
2646         * UIProcess/win/WebView.h:
2647         (WebKit::WebView::create):
2648
2649 2010-12-13  Anders Carlsson  <andersca@apple.com>
2650
2651         Fix build.
2652
2653         * UIProcess/WebPageProxy.h:
2654
2655 2010-12-13  Brian Weinstein  <bweinstein@apple.com>
2656
2657         Reviewed by Adam Roben.
2658
2659         WebKit2: Leaks a WebView when opening/closing Web Inspector on Windows
2660         https://bugs.webkit.org/show_bug.cgi?id=50975
2661         <rdar://problem/8763501>
2662         
2663         Make m_inspectorView be a RefPtr<WebView>, instead of a WebView*.
2664
2665         * UIProcess/WebInspectorProxy.cpp:
2666         (WebKit::WebInspectorProxy::WebInspectorProxy): If we are on Windows, include WebView.h.
2667         * UIProcess/WebInspectorProxy.h: Change the type of m_inspectorView to a RefPtr<WebView>.
2668         * UIProcess/win/WebInspectorProxyWin.cpp:
2669         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Remove the call to leakRef when creating the WebView.
2670
2671 2010-12-13  Anders Carlsson  <andersca@apple.com>
2672
2673         Reviewed by Darin Adler.
2674
2675         Pass the complex text input state all the way to the UI process
2676         https://bugs.webkit.org/show_bug.cgi?id=50980
2677
2678         * PluginProcess/PluginControllerProxy.cpp:
2679         (WebKit::PluginControllerProxy::setComplexTextInputEnabled):
2680         * UIProcess/WebPageProxy.cpp:
2681         (WebKit::WebPageProxy::setComplexTextInputEnabled):
2682         * UIProcess/WebPageProxy.h:
2683         * UIProcess/WebPageProxy.messages.in:
2684         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2685         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2686         (WebKit::NetscapePlugin::pluginComplexTextInputIdentifier):
2687         * WebProcess/Plugins/Plugin.h:
2688         * WebProcess/Plugins/PluginProxy.cpp:
2689         (WebKit::PluginProxy::pluginComplexTextInputIdentifier):
2690         (WebKit::PluginProxy::setComplexTextInputEnabled):
2691         * WebProcess/Plugins/PluginProxy.h:
2692         * WebProcess/Plugins/PluginProxy.messages.in:
2693         * WebProcess/Plugins/PluginView.cpp:
2694         (WebKit::PluginView::setComplexTextInputEnabled):
2695
2696 2010-12-13  Sam Weinig  <sam@webkit.org>
2697
2698         Reviewed by Anders Carlsson.
2699
2700         Change the WebKit2 public API so there is no explicit WKPageNamespace object
2701         https://bugs.webkit.org/show_bug.cgi?id=50898
2702
2703         * Shared/API/c/WKBase.h: Remove definition of WKPageNamespaceRef.
2704         * UIProcess/API/C/WKAPICast.h: Remove toAPI/toImpl for WKPageNamespaceRef.
2705
2706         * UIProcess/API/C/WKPage.cpp:
2707         * UIProcess/API/C/WKPage.h:
2708         Replace WKPageGetPageNamespace with WKPageGetContext.
2709
2710         * UIProcess/API/C/WKPageNamespace.cpp: Removed.
2711         * UIProcess/API/C/WKPageNamespace.h: Removed.
2712
2713         * UIProcess/API/C/WebKit2.h: Remove #include of WKPageNamespace.h.
2714
2715         * UIProcess/API/C/win/WKView.cpp:
2716         (WKViewCreate): Changed to take a WKContextRef instead of a WKPageNamespaceRef.
2717         (WKViewCreateUsingSharedProcess): Added. Similar to WKViewCreate except that
2718         all callers of it will have their views end up in the same shared process, whereas 
2719         with WKViewCreate, a new internal page namespace will be created and could place
2720         the view's WebPage into a new process.
2721         (WKViewCreateForAssociatedPage): Added. Creates a view that is forced to use the
2722         same process as the passed in page.
2723
2724         * UIProcess/win/WebView.cpp:
2725         (WebKit::WebView::WebView):
2726         (WebKit::WebView::initialize):
2727         * UIProcess/win/WebView.h:
2728         (WebKit::WebView::create):
2729         (WebKit::WebView::createUsingSharedProcess):
2730         (WebKit::WebView::createForAssociatedPage):
2731         Implementation of the WKView create functions.
2732
2733         * UIProcess/API/C/win/WKView.h:
2734         * UIProcess/API/mac/WKView.h:
2735         * UIProcess/API/mac/WKView.mm:
2736         (-[WKView initWithFrame:]):
2737         (-[WKView initWithFrame:contextRef:]):
2738         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
2739         (-[WKView initWithFrame:contextRef:usingSharedProcess:]):
2740         (-[WKView initWithFrame:contextRef:pageGroupRef:usingSharedProcess:]):
2741         (-[WKView initWithFrame:forAssociatedPageRef:]):
2742         (-[WKView initWithFrame:forAssociatedPageRef:pageGroupRef:]):
2743         (-[WKView initWithFrame:pageNamespace:pageGroup:]):
2744         Add new initializers for the objective-c WKView. It follows the same
2745         pattern as WKViewRef.
2746
2747         * UIProcess/API/qt/qwkcontext.cpp:
2748         (QWKContext::QWKContext):
2749         * UIProcess/API/qt/qwkcontext.h:
2750         Remove uses of WKPageNamespaceRef.
2751
2752         * UIProcess/WebContext.cpp:
2753         (WebKit::WebContext::sharedPageNamespace): Returns a shared
2754         page namespace used by the view's createUsingSharedProcess constructions.
2755         (WebKit::WebContext::createPageNamespace): Change to return
2756         a PassRefPtr to make things clearer.
2757         (WebKit::WebContext::pageNamespaceWasDestroyed): Clear the shared
2758         namespace if it is cleared.
2759         * UIProcess/WebContext.h:
2760
2761         * UIProcess/WebPageNamespace.h: Remove unused "struct WKContextStatistics".
2762
2763         * UIProcess/WebPageProxy.cpp:
2764         (WebKit::WebPageProxy::context):
2765         * UIProcess/WebPageProxy.h:
2766         Add context getter.
2767
2768         * UIProcess/mac/WebInspectorProxyMac.mm:
2769         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2770         * UIProcess/win/WebInspectorProxyWin.cpp:
2771         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2772         Use forAssociatedPageRef constructor for the WebInspector view.
2773
2774         * WebKit2.pro:
2775         * WebKit2.xcodeproj/project.pbxproj:
2776         * win/WebKit2.vcproj:
2777         * win/WebKit2Generated.make:
2778         Remove WKPageNamespace.h/cpp.
2779
2780 2010-12-13  Brent Fulgham  <bfulgham@webkit.org>
2781
2782         Unreviewed build fix.
2783
2784         * UIProcess/win/WebInspectorProxyWin.cpp: Non-Apple builds
2785         need to include <wtf/RetainPtr.h>.
2786
2787 2010-12-13  Brent Fulgham  <bfulgham@webkit.org>
2788
2789         Unreviewed build fix after r73807.
2790
2791         Added stub implementation of Download object.
2792
2793         * WebProcess/Downloads/curl: Added.
2794         * WebProcess/Downloads/curl/DownloadCurl.cpp: Added.
2795         (WebKit::Download::start):
2796         (WebKit::Download::startWithHandle):
2797         (WebKit::Download::cancel):
2798         (WebKit::Download::platformInvalidate):
2799         * win/WebKit2.vcproj: Exclude DownloadCFNet for Cairo builds,
2800         added DownloadCurl (excluded for regular Apple builds.)
2801
2802 2010-12-13  Anders Carlsson  <andersca@apple.com>
2803
2804         Reviewed by Sam Weinig.
2805
2806         Add the ability for plug-ins to toggle complex text input
2807         https://bugs.webkit.org/show_bug.cgi?id=50966
2808
2809         * PluginProcess/PluginControllerProxy.cpp:
2810         (WebKit::PluginControllerProxy::PluginControllerProxy):
2811         Initialize m_isComplexTextInputEnabled.
2812
2813         (WebKit::PluginControllerProxy::setComplexTextInputEnabled):
2814         Update m_isComplexTextInputEnabled.
2815
2816         * PluginProcess/PluginControllerProxy.h:
2817         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2818         (WebKit::NetscapePlugin::NetscapePlugin):
2819         Initialize m_pluginHasFocus and m_windowHasFocus.
2820
2821         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2822         (WebKit::NetscapePlugin::isWindowActive):
2823         Return m_windowHasFocus.
2824
2825         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2826         (WebKit::NetscapePlugin::platformSetFocus):
2827         Update m_pluginHasFocus and call setComplexTextInputEnabled.
2828
2829         (WebKit::NetscapePlugin::windowFocusChanged):
2830         Update m_windowHasFocus and call setComplexTextInputEnabled.
2831
2832         * WebProcess/Plugins/PluginController.h:
2833         Add setComplexTextInputEnabled.
2834
2835         * WebProcess/Plugins/PluginView.cpp:
2836         (WebKit::PluginView::setComplexTextInputEnabled):
2837         * WebProcess/Plugins/PluginView.h:
2838         Add setComplexTextInputEnabled
2839
2840 2010-12-13  David Hyatt  <hyatt@apple.com>
2841
2842         Reviewed by Adam Roben.
2843
2844         Remove the space behavior that I added.  It's covered in EventHandler in WebCore
2845         already for Windows.
2846
2847         * WebProcess/WebPage/win/WebPageWin.cpp:
2848         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
2849
2850 2010-12-13  David Hyatt  <hyatt@apple.com>
2851
2852         Reviewed by Sam Weinig.
2853
2854         https://bugs.webkit.org/show_bug.cgi?id=48545, Home/End, PageUp/PageDwn should respect writing-mode.  Use
2855         logical scrolling instead of physical scrolling for those keys in WebKit2.
2856
2857         * WebProcess/WebPage/mac/WebPageMac.mm:
2858         (WebKit::logicalScroll):
2859         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
2860         * WebProcess/WebPage/qt/WebPageQt.cpp:
2861         (WebKit::logicalScroll):
2862         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
2863         * WebProcess/WebPage/win/WebPageWin.cpp:
2864         (WebKit::logicalScroll):
2865         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
2866
2867 2010-12-13  Brian Weinstein  <bweinstein@apple.com>
2868
2869         Reviewed by Darin Adler.
2870
2871         WebKit2: Focusing Web Inspector window doesn't focus contents on Windows
2872         https://bugs.webkit.org/show_bug.cgi?id=50947
2873         <rdar://problem/8762468>
2874         
2875         When we get the notification that the inspector window has focused, focus the inner inspector view.
2876
2877         * UIProcess/WebInspectorProxy.h:
2878         * UIProcess/win/WebInspectorProxyWin.cpp:
2879         (WebKit::WebInspectorProxy::onSetFocusEvent): Set the focus of the inspector view, because that is what
2880             needs to be focused in the inspector window.
2881
2882 2010-12-13  Dan Bernstein  <mitz@apple.com>
2883
2884         Coding style fix.
2885
2886         * WebProcess/Downloads/mac/DownloadMac.mm:
2887         (WebKit::originatingURLFromBackForwardList):
2888
2889 2010-12-13  Balazs Kelemen  <kbalazs@webkit.org>
2890
2891         Unreviewed trivial build fix (linux, 64 bit, gcc-4.5.1)
2892
2893         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2894         (WebKit::WebChromeClient::exceededDatabaseQuota):
2895         Don't use unsigned long long as alias for uint64_t.
2896
2897 2010-12-13  Anders Carlsson  <andersca@apple.com>
2898
2899         Reviewed by John Sullivan.
2900
2901         Crash when clicking a download link that targets a new tab
2902         https://bugs.webkit.org/show_bug.cgi?id=50935
2903         <rdar://problem/8760572>
2904
2905         Check for a null history item.
2906
2907         * WebProcess/Downloads/mac/DownloadMac.mm:
2908         (WebKit::originatingURLFromBackForwardList):
2909
2910 2010-12-13  Andras Becsi  <abecsi@webkit.org>
2911
2912         Reviewed by Csaba Osztrogonác.
2913
2914         [Qt][WK2] Fix build if WebKitTools are not available
2915         https://bugs.webkit.org/show_bug.cgi?id=50242
2916
2917         * DerivedSources.pro: Remove dependency to WebKitTools.
2918         * Scripts/generate-forwarding-headers.pl: Moved from WebKitTools/Scripts/generate-forwarding-headers.pl.
2919
2920 2010-12-13  Csaba Osztrogonác  <ossy@webkit.org>
2921
2922         Unreviewed.
2923
2924         * WebKit2.pro: Remove non-existant Shared/DrawingAreaBase.h from build system.
2925
2926 2010-10-28  MORITA Hajime  <morrita@google.com>
2927
2928         Reviewed by Ojan Vafai.
2929
2930         spellcheck does not check pasted text
2931         https://bugs.webkit.org/show_bug.cgi?id=40092
2932
2933         Added a stub implememntation.
2934
2935         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2936         (WebKit::WebEditorClient::requestCheckingOfString):
2937         * WebProcess/WebCoreSupport/WebEditorClient.h:
2938
2939 2010-12-12  Brian Weinstein  <bweinstein@apple.com>
2940
2941         Reviewed by Tim Hatcher.
2942
2943         WebKit2: Implement WebInspector::localizedStringsURL on Windows
2944         https://bugs.webkit.org/show_bug.cgi?id=50896
2945         
2946         Find the localized strings file using CFBundleCopyResourceURL.
2947
2948         * WebProcess/WebPage/win/WebInspectorWin.cpp:
2949         (WebKit::WebInspector::localizedStringsURL):
2950
2951 2010-12-12  Sam Weinig  <sam@webkit.org>
2952
2953         Reviewed by Anders Carlsson.
2954
2955         Give LogTextInput a sensible flag value.
2956
2957         * Platform/Logging.cpp:
2958
2959 2010-12-12  Sam Weinig  <sam@webkit.org>
2960
2961         Reviewed by Anders Carlsson.
2962
2963         Remove incorrect assertion that has been firing in the API tester.
2964
2965         * UIProcess/WebDatabaseManagerProxy.cpp:
2966         (WebKit::WebDatabaseManagerProxy::~WebDatabaseManagerProxy):
2967
2968 2010-12-12  Sam Weinig  <sam@webkit.org>
2969
2970         Reviewed by Anders Carlsson.
2971
2972         Disable WebKit2 logging by default.
2973         https://bugs.webkit.org/show_bug.cgi?id=50878
2974
2975         * Platform/Logging.cpp:
2976         (initializeLogChannelsIfNecessary):
2977
2978 2010-12-11  Brian Weinstein  <bweinstein@apple.com>
2979
2980         Reviewed by Sam Weinig.
2981
2982         Web Inspector: Make inspector on Windows show and be usable in WebKit2
2983         https://bugs.webkit.org/show_bug.cgi?id=50877
2984         
2985         Hook up the unimplemented methods in WebInspectorProxyWin to get the web inspector
2986         showing and usable in WebKit2 on Windows.
2987
2988         * UIProcess/WebInspectorProxy.cpp:
2989         (WebKit::WebInspectorProxy::WebInspectorProxy): Initialize Windows-specific variables to 0.
2990         * UIProcess/WebInspectorProxy.h:
2991         * UIProcess/win/WebInspectorProxyWin.cpp:
2992         (WebKit::WebInspectorProxy::registerInspectorViewWindowClass): Sets up the inspector view class.
2993         (WebKit::WebInspectorProxy::InspectorViewWndProc): Calls through to the WebInspectorProxy's non-static
2994             WndProc.
2995         (WebKit::WebInspectorProxy::wndProc): Handles WM_SIZE, WM_CLOSE, and WM_GETMINMAXINFO, the rest go to 
2996             ::DefWindowProc.
2997         (WebKit::WebInspectorProxy::onSizeEvent): Resize the WKView that has the inspector page to match the
2998             outer window that was just resized.
2999         (WebKit::WebInspectorProxy::onMinMaxInfoEvent): Set the minimum size the window can be resized to.
3000         (WebKit::WebInspectorProxy::onCloseEvent): Hide the window, and call WebInspectorProxy::close.
3001         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Create a WKView and return its page.
3002         (WebKit::WebInspectorProxy::platformOpen): Create an HWND for the inspector, put the inspector's WKView
3003             inside of it, and show the window.
3004         (WebKit::WebInspectorProxy::platformClose): Destroy the inspector's window (which destroys the child WKView), 
3005             and 0 out instance variables.
3006         (WebKit::WebInspectorProxy::inspectorPageURL): Finds inspector/inspector.html in the WebKit bundle.
3007
3008 2010-12-12  Balazs Kelemen  <kbalazs@webkit.org>
3009
3010         Reviewed by Andreas Kling.
3011
3012         [Qt][WK2] Crash in WebPage constructor.
3013         https://bugs.webkit.org/show_bug.cgi?id=50892
3014
3015         * WebProcess/qt/WebProcessQt.cpp:
3016         (WebKit::WebProcess::platformInitializeWebProcess):
3017         Disable runtime enabled features that have no WebKit2 implementation yet.
3018
3019 2010-12-10  Jon Honeycutt  <jhoneycutt@apple.com>
3020
3021         Select menus with short option titles do not paint properly
3022         https://bugs.webkit.org/show_bug.cgi?id=50860
3023         <rdar://problem/8660807>
3024
3025         The backing stores used for painting the popup menu items were only as
3026         wide as the widest option title, but the popup window that we create is
3027         at least as wide as the <select> element. This adjusts the backing
3028         stores to be at least as wide as the <select>, as well.
3029
3030         Reviewed by Sam Weinig.
3031
3032         * UIProcess/win/WebPopupMenuProxyWin.cpp:
3033         (WebKit::WebPopupMenuProxyWin::paint):
3034         Paint using the width of the backing store.
3035
3036         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
3037         (WebKit::WebPopupMenu::show):
3038         Pass the page coordinates of the <select> element to
3039         setUpPlatformData().
3040
3041         * WebProcess/WebCoreSupport/WebPopupMenu.h:
3042         Added new parameter to setUpPlatformData().
3043
3044         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
3045         (WebKit::WebPopupMenu::setUpPlatformData):
3046         Ditto.
3047
3048         * WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp:
3049         (WebKit::WebPopupMenu::setUpPlatformData):
3050         Ditto.
3051
3052         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
3053         (WebKit::WebPopupMenu::setUpPlatformData):
3054         Fixed a typo in a comment. Adjust the backing store size to be at least
3055         as wide as the <select> element, and use that width when painting the
3056         items to the backing store.
3057
3058 2010-12-11  Csaba Osztrogonác  <ossy@webkit.org>
3059
3060         Unreviewed Qt buildfix after r73808.
3061
3062         WebKit2: Need a WebKit2 equivalent of the WebKit1 WebDatabaseManager
3063         https://bugs.webkit.org/show_bug.cgi?id=50606
3064
3065         * DerivedSources.pro:
3066
3067 2010-12-11  Sheriff Bot  <webkit.review.bot@gmail.com>
3068
3069         Unreviewed, rolling out r73834.
3070         http://trac.webkit.org/changeset/73834
3071         https://bugs.webkit.org/show_bug.cgi?id=50866
3072
3073         It broke Qt-WebKit2 build, because of missing WK2_DIR variable
3074         (Requested by Ossy on #webkit).
3075
3076         * WebKit2.pro:
3077
3078 2010-12-10  Siddharth Mathur  <siddharth.mathur@nokia.com>
3079
3080         Reviewed by Eric Seidel.
3081
3082         [Qt][WK2] Make WebKit2 static library compile on Symbian
3083         https://bugs.webkit.org/show_bug.cgi?id=50861
3084
3085         * WebKit2.pro:
3086
3087 2010-12-10  Sam Weinig  <sam@webkit.org>
3088
3089         Reviewed by Anders Carlsson.
3090
3091         Ensure that we are not getting too many wheel events
3092         <rdar://problem/7881465>
3093
3094         Add simple coalescing of wheel events being sent to the WebProcess. This 
3095         adds two models, one which drops interim events and one which merges events
3096         together. For now, we are using the simpler dropping model.
3097
3098         * Shared/WebEvent.h:
3099         (WebKit::WebEvent::modifiers):
3100         * UIProcess/WebPageProxy.cpp:
3101         (WebKit::WebPageProxy::WebPageProxy):
3102         (WebKit::coalesceWheelEvents):
3103         (WebKit::WebPageProxy::handleWheelEvent):
3104         (WebKit::WebPageProxy::didReceiveEvent):
3105         * UIProcess/WebPageProxy.h:
3106
3107 2010-12-10  Anders Carlsson  <andersca@apple.com>
3108
3109         Reviewed by John Sullivan.
3110
3111         Make WKContextGetStatistics gather global statistics
3112         https://bugs.webkit.org/show_bug.cgi?id=50850
3113
3114         Change WKContextGetStatistics to work on all objects in the process, and
3115         make it more robust by incrementing/decrementing the counts in the constructor
3116         and destructor respectively. 
3117         
3118         Also, rename WKContextGetStatistics to WKContextGetGlobalStatistics to better match
3119         what it's actually doing.
3120
3121         * UIProcess/API/C/WKContext.cpp:
3122         (WKContextGetStatistics):
3123         * UIProcess/API/C/WKContextPrivate.h:
3124         * UIProcess/API/mac/WKView.mm:
3125         (-[WKView initWithFrame:pageNamespaceRef:pageGroupRef:]):
3126         (-[WKView dealloc]):
3127         * UIProcess/WebContext.cpp:
3128         (WebKit::WebContext::statistics):
3129         * UIProcess/WebContext.h:
3130         * UIProcess/WebFrameProxy.cpp:
3131         (WebKit::WebFrameProxy::WebFrameProxy):
3132         (WebKit::WebFrameProxy::~WebFrameProxy):
3133         * UIProcess/WebPageNamespace.cpp:
3134         * UIProcess/WebPageNamespace.h:
3135         * UIProcess/WebPageProxy.cpp:
3136         (WebKit::WebPageProxy::WebPageProxy):
3137         (WebKit::WebPageProxy::~WebPageProxy):
3138         * UIProcess/WebPageProxy.h:
3139
3140 2010-12-10  Brian Weinstein  <bweinstein@apple.com>
3141
3142         Reviewed by Darin Adler.
3143
3144         WebKit2: Context menu support on Windows
3145         <https://bugs.webkit.org/show_bug.cgi?id=50514>
3146         
3147         Implment showing of the context menu on Windows for WebKit2, and calling through to
3148         WebPageProxy::contextMenuItemSelected.
3149
3150         * UIProcess/win/WebContextMenuProxyWin.cpp:
3151         (WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin): Initialize the member variables.
3152         (WebKit::WebContextMenuProxyWin::populateMenu): Iterate over the vector of WebContextMenuItemData
3153             that was passed in, adding the menu items and recursively calling back into this function to populate
3154             any submenus that are needed. This function also sets up the map from action identifierss to WebContextMenuItemData,
3155             to use to find the WebContextMenuItemData from a selected menu item.
3156         (WebKit::WebContextMenuProxyWin::showContextMenu): Destroy any menu we have already created, populate the menu
3157             to show, and show the context menu. Once TrackPopupMenuEx returns, it returns identifier of the selected menu item.
3158             Look up that identifier in the map we created, and tell the WebPageProxy that a context menu item was selected.
3159         (WebKit::WebContextMenuProxyWin::hideContextMenu): Destroy the HMENU if it is non-null, and clear the identifier map. 
3160         * UIProcess/win/WebContextMenuProxyWin.h:
3161         (WebKit::WebContextMenuProxyWin::create): Call through to the constructor, and change the arguments that it takes.
3162         * UIProcess/win/WebView.cpp:
3163         (WebKit::WebView::createContextMenuProxy): Call with the correct arguments.
3164
3165 2010-12-10  Jessie Berlin  <jberlin@apple.com>
3166
3167         Qt Build Fix. Unreviewed.
3168
3169         * WebKit2.pro:
3170         Add the Messages.h and MessageReceivers.h.
3171
3172 2010-12-10  Jessie Berlin  <jberlin@apple.com>
3173
3174         Reviewed by Adam Roben and Sam Weinig.
3175
3176         WebKit2: Need a WebKit2 equivalent of the WebKit1 WebDatabaseManager
3177         https://bugs.webkit.org/show_bug.cgi?id=50606
3178
3179         Add a WebDatabaseManagerProxy owned by the WebContext.
3180
3181         Expose API (similar to the WebKit1 API) to get a list of origins for which there are
3182         Databases, delete all the databases for a given origin, and delete all the databases.
3183
3184         Add WebDatabaseManager and WebDatabaseManagerProxy as messages receivers.
3185         * DerivedSources.make:
3186         * Platform/CoreIPC/MessageID.h:
3187
3188         Add the WebDatabaseManagerProxy as a UIProcess type (DatabaseManager).
3189         * Shared/API/c/WKBase.h:
3190         * Shared/APIObject.h:
3191         * UIProcess/API/C/WKAPICast.h:
3192
3193         * UIProcess/API/C/WKContext.cpp:
3194         (WKContextGetDatabaseManager):
3195         Expose API to get the DatabaseManager.
3196         * UIProcess/API/C/WKContext.h:
3197
3198         * UIProcess/API/C/WKDatabaseManager.cpp: Added.
3199         (WKDatabaseManagerGetTypeID):
3200         (WKDatabaseManagerGetDatabaseOrigins):
3201         (callGetDatabaseOriginsBlockBlockAndDispose):
3202         (WKDatabaseManagerGetDatabaseOrigins_b):
3203         (WKDatabaseManagerDeleteDatabasesForOrigin):
3204         (WKDatabaseManagerDeleteAllDatabases):
3205         * UIProcess/API/C/WKDatabaseManager.h: Added.
3206
3207         * UIProcess/WebContext.cpp:
3208         (WebKit::WebContext::WebContext):
3209         Create the WebDatabaseManagerProxy.
3210         (WebKit::WebContext::processDidClose):
3211         Invalidate the WebDatabaseManagerProxy.
3212         (WebKit::WebContext::didReceiveMessage):
3213         Forward messages to the WebDatabaseManagerProxy.
3214         * UIProcess/WebContext.h:
3215         (WebKit::WebContext::databaseManagerProxy):
3216
3217         * UIProcess/WebDatabaseManagerProxy.cpp: Added.
3218         (WebKit::WebDatabaseManagerProxy::create):
3219         (WebKit::WebDatabaseManagerProxy::WebDatabaseManagerProxy):
3220         (WebKit::WebDatabaseManagerProxy::~WebDatabaseManagerProxy):
3221         (WebKit::WebDatabaseManagerProxy::invalidate):
3222         Invalidate the map of callbacks for getDatabaseOrigins.
3223         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
3224         Store the callback and send the request for the origins which have databases to the
3225         WebProcess.
3226         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
3227         Call the callback function with the SecurityOrigins created from the identifiers received.
3228         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
3229         If the origin exists, send the message on to the WebProcess to delete the databases
3230         associated with that origin.
3231         (WebKit::WebDatabaseManagerProxy::deleteAllDatabases):
3232         Send the message to the WebProcess to delete all the databases.
3233         * UIProcess/WebDatabaseManagerProxy.h: Added.
3234         (WebKit::WebDatabaseManagerProxy::type):
3235         * UIProcess/WebDatabaseManagerProxy.messages.in: Added.
3236
3237         * UIProcess/WebPageProxy.cpp:
3238         Move invalidateCallbackMap from here ...
3239         * UIProcess/GenericCallback.h:
3240         (WebKit::invalidateCallbackMap):
3241         .. to here so that it can be used elsewhere (e.g. by WebDatabaseManagerProxy).
3242
3243         * UIProcess/WebProcessProxy.cpp:
3244         (WebKit::WebProcessProxy::didReceiveMessage):
3245         Forward on all messages destined for the WebDatabaseManagerProxy to the WebContext.
3246
3247         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
3248         (WebKit::WebDatabaseManager::didReceiveMessage):
3249         (WebKit::WebDatabaseManager::getDatabaseOrigins):
3250         Send an array of the identifiers for the SecurityOrigins for which there are databases to
3251         the UIProcess.
3252         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
3253         If the SecurityOrigin with that identifier exists, tell the DatabaseTracker to delete the
3254         databases for that origin.
3255         (WebKit::WebDatabaseManager::deleteAllDatabases):
3256         Tell the DatabaseTracker to delete the databases for that origin.
3257         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
3258         * WebProcess/WebCoreSupport/WebDatabaseManager.messages.in: Added.
3259         * WebProcess/WebProcess.cpp:
3260         (WebKit::WebProcess::didReceiveMessage):
3261
3262         * WebKit2.pro:
3263         Add WKDatabaseManager.cpp/.h and WebDatabaseManagerProxy.cpp/.h
3264         * WebKit2.xcodeproj/project.pbxproj:
3265         Ditto, also add WebDatabaseManagerProxy.messages.in and WebDatabaseManager.messages.in.
3266         * win/WebKit2.vcproj:
3267         Ditto.
3268         * win/WebKit2Generated.make:
3269         Make sure WKDatabaseManager.h is copied into WebKitBuild on Windows.
3270
3271 2010-12-10  Ada Chan  <adachan@apple.com>
3272
3273         Reviewed by Anders Carlsson.
3274
3275         Implement Download::start() and Download::startWithHandle() on Windows.
3276         https://bugs.webkit.org/show_bug.cgi?id=50844
3277
3278         * WebProcess/Downloads/Download.h:
3279         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
3280         (WebKit::Download::start): Create a CFURLDownloadRef and schedule it.
3281         (WebKit::Download::startWithHandle): Create a CFURLDownloadRef with the loading connection
3282         retrieved from the ResourceHandle.
3283         (WebKit::Download::platformInvalidate):
3284         (WebKit::downloadFromClientInfo):
3285         (WebKit::didStartCallback):
3286         (WebKit::willSendRequestCallback):
3287         (WebKit::didReceiveAuthenticationChallengeCallback):
3288         (WebKit::didReceiveResponseCallback):
3289         (WebKit::willResumeWithResponseCallback):
3290         (WebKit::didReceiveDataCallback):
3291         (WebKit::shouldDecodeDataOfMIMETypeCallback):
3292         (WebKit::decideDestinationWithSuggestedObjectNameCallback):
3293         (WebKit::didCreateDestinationCallback):
3294         (WebKit::didFinishCallback):
3295         (WebKit::didFailCallback):
3296
3297 2010-12-10  Enrica Casucci  <enrica@apple.com>
3298
3299         Windows build fix. Unreviewed.
3300
3301         Adding a dummy synchronous message for platforms
3302         that don't have any.
3303
3304         * WebProcess/WebPage/WebPage.cpp:
3305         (WebKit::WebPage::dummy):
3306         * WebProcess/WebPage/WebPage.h:
3307         * WebProcess/WebPage/WebPage.messages.in:
3308
3309 2010-12-09  Brian Weinstein  <bweinstein@apple.com>
3310
3311         Reviewed by Adam Roben.
3312
3313         Prep for WebKit2: Context menu support on Windows
3314         https://bugs.webkit.org/show_bug.cgi?id=50514
3315         
3316         Update WebKit2 to call the correct code when CROSS_PLATFORM_CONTEXT_MENUS is set.
3317
3318         * Shared/WebContextMenuItemData.cpp:
3319         (WebKit::WebContextMenuItemData::WebContextMenuItemData): Add a branch based on whether or not 
3320             CROSS_PLATFORM_CONTEXT_MENUS is set.
3321         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
3322         (WebKit::WebContextMenuClient::customizeMenu): Define different functions based on
3323             whether or not CROSS_PLATFORM_CONTEXT_MENUS. Both of these are stubs, so functionality
3324             doesn't need to be shared.
3325         * WebProcess/WebCoreSupport/WebContextMenuClient.h: Define different functions based on
3326             whether or not CROSS_PLATFORM_CONTEXT_MENUS. 
3327         * WebProcess/WebPage/WebContextMenu.cpp:
3328         (WebKit::WebContextMenu::show): Add a branch based on whether or not 
3329             CROSS_PLATFORM_CONTEXT_MENUS is set.
3330
3331 2010-12-09  Enrica Casucci  <enrica@apple.com>
3332
3333         Reviewed by Alexey Proskuryakov.
3334
3335         Implement IME support for Mac.
3336         <rdar://problem/7660589> WebKit2: Implement IME support for Mac.
3337         https://bugs.webkit.org/show_bug.cgi?id=50788
3338             
3339         This patch addes support for input methods in WebKit2.
3340         In order to support IME, it was necessary to add synchronous calls from the UIProcess
3341         to the WebProcess. These calls all have a timeout of 1 second.
3342         The current implementation still uses the NSTextInput protocol, but the plan is to move
3343         to the NSTextInputClient protocol. This has not been done yet for ease of comparison with
3344         WebKit. attributedSubstringFromRange is the only method that has not been implemented, because
3345         I have not yet decided what is the best way to send an NSAttributedString across the process
3346         boundary.
3347
3348         * Platform/CoreIPC/HandleMessage.h:
3349         (CoreIPC::callMemberFunction): Added template for member function.
3350         with four reply arguments.
3351         * Scripts/webkit2/messages.py: Added CompositionUnderline and relevant header.
3352         * Shared/WebCoreArgumentCoders.h:
3353         (CoreIPC::): Added encoder/decoder for CompositionUnderline.
3354         * UIProcess/API/mac/PageClientImpl.h: Added parameters to interceptKeyEvent and selectionChanged.
3355         * UIProcess/API/mac/PageClientImpl.mm:
3356         (WebKit::PageClientImpl::selectionChanged): Added parameters.
3357         (WebKit::PageClientImpl::interceptKeyEvent): Added parameters.
3358         * UIProcess/API/mac/WKView.mm:
3359         (-[WKView initWithFrame:pageNamespaceRef:pageGroupRef:]): Added initialization of new private members.
3360         (-[WKView insertText:]):
3361         (-[WKView _selectionChanged:isEditable:isPassword:hasMarkedText:range:]): Added parameters.
3362         (-[WKView _interceptKeyEvent:hasComposition:start:end:lines:WebCore::]): Added parameters.
3363         (-[WKView keyDown:]): Modified to reset state on each keyDown.
3364         (-[WKView selectedRange]): Added.
3365         (-[WKView hasMarkedText]): Added.
3366         (-[WKView unmarkText]): Added.
3367         (-[WKView validAttributesForMarkedText]): Added.
3368         (extractUnderlines): Added.
3369         (-[WKView setMarkedText:selectedRange:]): Added.
3370         (-[WKView markedRange]): Added.
3371         (-[WKView attributedSubstringFromRange:]): Added.
3372         (-[WKView characterIndexForPoint:]): Added.
3373         (-[WKView firstRectForCharacterRange:]): Added.
3374         (-[WKView conversationIdentifier]): Added.
3375         * UIProcess/API/mac/WKViewInternal.h: Added parameters to _interceptKeyEvent and _selectionChanged.
3376         * UIProcess/PageClient.h: Added parameters to interpretKeyEvent and selectionChanged.
3377         * UIProcess/WebPageProxy.cpp:
3378         (WebKit::WebPageProxy::getMarkedRange): Added.
3379         (WebKit::WebPageProxy::characterIndexForPoint): Added.
3380         (WebKit::WebPageProxy::firstRectForCharacterRange): Added.
3381         (WebKit::WebPageProxy::interpretKeyEvent): Additional parameters.
3382         (WebKit::WebPageProxy::didSelectionChange): Additional parameters for Mac platform.
3383         * UIProcess/WebPageProxy.h: Added new methods and parameters to didSelectionChange
3384         and interpretKeyEvent.
3385         * UIProcess/WebPageProxy.messages.in: Added parameters to interpretKeyEvent and selectionChanged messages.
3386         * UIProcess/WebProcessProxy.h:
3387         (WebKit::WebProcessProxy::sendSync): Added support for synchronous messages.
3388         The default timeout is 1 second.
3389         * WebProcess/WebCoreSupport/WebEditorClient.cpp: respondToChangedSelection is now
3390         only for non Mac platform.
3391         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3392         (WebKit::WebEditorClient::respondToChangedSelection): Added implementation for Mac platform.
3393         * WebProcess/WebPage/WebPage.cpp:
3394         (WebKit::WebPage::didReceiveSyncMessage): Added.
3395         * WebProcess/WebPage/WebPage.h: Added new methods and support for synchronous messages.
3396         * WebProcess/WebPage/WebPage.messages.in: Added new messages.
3397         * WebProcess/WebPage/mac/WebPageMac.mm:
3398         (WebKit::WebPage::interceptEditingKeyboardEvent): Added parameters.
3399         (WebKit::WebPage::convertRangeToPlatformRange): Added.
3400         (WebKit::WebPage::getMarkedRange): Added.
3401         (WebKit::characterRangeAtPoint): Added.
3402         (WebKit::WebPage::characterIndexForPoint): Added.
3403         (WebKit::convertToRange): Added.
3404         (WebKit::WebPage::firstRectForCharacterRange): Added.
3405         * WebProcess/WebProcess.cpp:
3406         (WebKit::WebProcess::didReceiveSyncMessage): Added.
3407         * WebProcess/WebProcess.h: Added didReceiveSyncMessage.
3408
3409 2010-12-10  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3410
3411         Reviewed by Kenneth Rohde Christiansen.
3412
3413         [Qt][WK2] Add the QWKContext API class to wrap the WebContext.
3414         https://bugs.webkit.org/show_bug.cgi?id=50750
3415
3416         * UIProcess/API/qt/WKView.h:
3417         * UIProcess/API/qt/qgraphicswkview.cpp:
3418         (QGraphicsWKView::QGraphicsWKView):
3419         Change the WKPageNamespaceRef argument to QWKContext*
3420         * UIProcess/API/qt/qgraphicswkview.h:
3421         * UIProcess/API/qt/qwkcontext.cpp: Added.
3422         * UIProcess/API/qt/qwkcontext.h: Added.
3423         * UIProcess/API/qt/qwkcontext_p.h: Added.
3424         * UIProcess/API/qt/qwkpage.cpp:
3425         (QWKPagePrivate::QWKPagePrivate):
3426         (QWKPage::QWKPage):
3427         Change the WKPageNamespaceRef argument to QWKContext*
3428         * UIProcess/API/qt/qwkpage.h:
3429         * UIProcess/API/qt/qwkpage_p.h:
3430         * WebKit2.pro:
3431
3432 2010-12-10  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
3433
3434         Reviewed by Kenneth Rohde Christiansen.
3435
3436         Flush IPC connection send buffer after each message.
3437
3438         [Qt] [WK2] IPC messages are not sent until send buffer fills up
3439         https://bugs.webkit.org/show_bug.cgi?id=50667
3440
3441         * Platform/CoreIPC/qt/ConnectionQt.cpp:
3442         (CoreIPC::Connection::sendOutgoingMessage):
3443
3444 2010-12-09  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3445
3446         Reviewed by Kenneth Rohde Christiansen.
3447
3448         [Qt][WK2] Use a single QNetworkAccessManager per web process.
3449         https://bugs.webkit.org/show_bug.cgi?id=50757
3450
3451         This allows a better management of network resources and the use
3452         of global cookie jar and disk cache across all frames.
3453
3454         * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp:
3455         (WebCore::WebFrameNetworkingContext::WebFrameNetworkingContext):
3456         (WebCore::WebFrameNetworkingContext::networkAccessManager):
3457         * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h:
3458         * WebProcess/WebProcess.cpp:
3459         (WebKit::WebProcess::WebProcess):
3460         (WebKit::WebProcess::initializeWebProcess):
3461         (WebKit::WebProcess::shutdownIfPossible):
3462         * WebProcess/WebProcess.h:
3463         (WebKit::WebProcess::networkAccessManager):
3464         * WebProcess/mac/WebProcessMac.mm:
3465         (WebKit::WebProcess::platformInitializeWebProcess):
3466         (WebKit::WebProcess::platformShutdown):
3467         * WebProcess/qt/WebProcessQt.cpp:
3468         (WebKit::WebProcess::platformInitializeWebProcess):
3469         (WebKit::WebProcess::platformShutdown):
3470         * WebProcess/win/WebProcessWin.cpp:
3471         (WebKit::WebProcess::platformInitializeWebProcess):
3472         (WebKit::WebProcess::platformShutdown):
3473
3474 2010-12-09  Mark Rowe  <mrowe@apple.com>
3475
3476         Fix the 32-bit build.
3477
3478         * Shared/cf/ArgumentCodersCF.cpp:
3479         (CoreIPC::sizeForNumberType):
3480
3481 2010-12-09  Maciej Stachowiak  <mjs@apple.com>
3482
3483         Reviewed by Brady Eidson.
3484
3485         WebKit2: Control-click doesn't invoke context menu
3486         https://bugs.webkit.org/show_bug.cgi?id=50793
3487         <rdar://problem/8664800>
3488
3489         * WebProcess/WebPage/WebPage.cpp:
3490         (WebKit::isContextClick): New helper function - on Mac, not only right clicks
3491         but also control-left-clicks are context clicks.
3492         (WebKit::handleMouseEvent): Use above.
3493
3494 2010-12-09  Anders Carlsson  <andersca@apple.com>
3495
3496         Fix clang++ build.
3497
3498         * Scripts/webkit2/messages.py:
3499         DrawingAreaInfo is a struct.
3500
3501         * Shared/WebPreferencesStore.cpp:
3502         (WebKit::valueForKey):
3503         Move valueForKey above code that uses it.
3504
3505         * UIProcess/mac/WebInspectorProxyMac.mm:
3506         (-[WebInspectorProxyObjCAdapter windowWillClose:]):
3507         Remove trailing semicolon.
3508
3509 2010-12-09  Timothy Hatcher  <timothy@apple.com>
3510
3511         Add support for transparent WebKit2 WKViews.
3512
3513         https://webkit.org/b/50785
3514
3515         Reviewed by Anders Carlsson.
3516
3517         * Shared/WebPageCreationParameters.cpp:
3518         (WebKit::WebPageCreationParameters::encode): Encode drawsBackground and drawsTransparentBackground.
3519         (WebKit::WebPageCreationParameters::decode): Decode drawsBackground and drawsTransparentBackground.
3520         * Shared/WebPageCreationParameters.h:
3521         * UIProcess/API/mac/WKView.h:
3522         * UIProcess/API/mac/WKView.mm:
3523         (-[WKView setDrawsBackground:]): Added.
3524         (-[WKView drawsBackground]): Added.
3525         (-[WKView setDrawsTransparentBackground:]): Added.
3526         (-[WKView drawsTransparentBackground]): Added.
3527         (-[WKView drawRect:]): Only fill the background if the WebProcess isn't valid and drawsBackground.
3528         Use white or clear based on setDrawsTransparentBackground.
3529         (-[WKView isOpaque]): Return drawsBackground.
3530         * UIProcess/WebPageProxy.cpp:
3531         (WebKit::WebPageProxy::WebPageProxy): Initialize m_drawsBackground and m_drawsTransparentBackground.
3532         (WebKit::WebPageProxy::setDrawsBackground): Added. Send a SetDrawsBackground message.
3533         (WebKit::WebPageProxy::setDrawsTransparentBackground): Added. Send a SetDrawsTransparentBackground message.
3534         (WebKit::WebPageProxy::creationParameters): Set drawsBackground and drawsTransparentBackground.
3535         * UIProcess/WebPageProxy.h:
3536         (WebKit::WebPageProxy::drawsBackground): Added. Return m_drawsBackground.
3537         (WebKit::WebPageProxy::drawsTransparentBackground): Added. Return m_drawsTransparentBackground.
3538         * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
3539         (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint): Use the copy blend mode when drawing a background.
3540         (WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore): Use the copy blend mode to replace existing content.
3541         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3542         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Setup the new view's background color and transparent flag.
3543         * WebProcess/WebPage/WebPage.cpp:
3544         (WebKit::WebPage::WebPage): Initialize m_drawsBackground and m_drawsTransparentBackground.
3545         (WebKit::WebPage::setDrawsBackground): Added. Propagate the flag to the FrameViews.
3546         (WebKit::WebPage::setDrawsTransparentBackground): Added. Propagate the background color to the FrameViews.
3547         * WebProcess/WebPage/WebPage.h:
3548         (WebKit::WebPage::drawsBackground): Added. Return m_drawsBackground.
3549         (WebKit::WebPage::drawsTransparentBackground): Added. Return m_drawsTransparentBackground.
3550         * WebProcess/WebPage/WebPage.messages.in: Added SetDrawsBackground and SetDrawsTransparentBackground.
3551
3552 2010-12-09  Anders Carlsson  <andersca@apple.com>
3553
3554         Reviewed by Sam Weinig.
3555
3556         Cannot use NSKeyedArchiver in WK2 for ResourceResponses
3557         https://bugs.webkit.org/show_bug.cgi?id=50792
3558         <rdar://problem/8741799>
3559
3560         When encoding, first convert the requests and responses to the serializable dictionary representation
3561         and use the newly added CF CoreIPC encoders. When decoding, do the opposite.
3562
3563         * Shared/mac/WebCoreArgumentCodersMac.mm:
3564         (CoreIPC::encodeResourceRequest):
3565         (CoreIPC::decodeResourceRequest):
3566         (CoreIPC::encodeResourceResponse):
3567         (CoreIPC::decodeResourceResponse):
3568
3569 2010-12-09  Anders Carlsson  <andersca@apple.com>
3570
3571         Reviewed by Sam Weinig.
3572
3573         Add CoreIPC coders for CF types
3574         https://bugs.webkit.org/show_bug.cgi?id=50791
3575
3576         * Platform/CoreIPC/ArgumentDecoder.h:
3577         (CoreIPC::ArgumentDecoder::decodeEnum):
3578         * Platform/CoreIPC/ArgumentEncoder.h:
3579         (CoreIPC::ArgumentEncoder::encodeEnum):
3580         * Shared/cf/ArgumentCodersCF.cpp: Added.
3581         (CoreIPC::tokenNullTypeRef):
3582         (CoreIPC::typeFromCFTypeRef):
3583         (CoreIPC::encode):
3584         (CoreIPC::decode):
3585         (CoreIPC::sizeForNumberType):
3586         * Shared/cf/ArgumentCodersCF.h: Added.
3587         * WebKit2.xcodeproj/project.pbxproj:
3588