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