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