148e502dcd2d3a9671761d0868e2021599fd56ee
[WebKit.git] / WebKit2 / ChangeLog
1 2010-12-09  Anders Carlsson  <andersca@apple.com>
2
3         Fix clang++ build.
4
5         * Scripts/webkit2/messages.py:
6         DrawingAreaInfo is a struct.
7
8         * Shared/WebPreferencesStore.cpp:
9         (WebKit::valueForKey):
10         Move valueForKey above code that uses it.
11
12         * UIProcess/mac/WebInspectorProxyMac.mm:
13         (-[WebInspectorProxyObjCAdapter windowWillClose:]):
14         Remove trailing semicolon.
15
16 2010-12-09  Timothy Hatcher  <timothy@apple.com>
17
18         Add support for transparent WebKit2 WKViews.
19
20         https://webkit.org/b/50785
21
22         Reviewed by Anders Carlsson.
23
24         * Shared/WebPageCreationParameters.cpp:
25         (WebKit::WebPageCreationParameters::encode): Encode drawsBackground and drawsTransparentBackground.
26         (WebKit::WebPageCreationParameters::decode): Decode drawsBackground and drawsTransparentBackground.
27         * Shared/WebPageCreationParameters.h:
28         * UIProcess/API/mac/WKView.h:
29         * UIProcess/API/mac/WKView.mm:
30         (-[WKView setDrawsBackground:]): Added.
31         (-[WKView drawsBackground]): Added.
32         (-[WKView setDrawsTransparentBackground:]): Added.
33         (-[WKView drawsTransparentBackground]): Added.
34         (-[WKView drawRect:]): Only fill the background if the WebProcess isn't valid and drawsBackground.
35         Use white or clear based on setDrawsTransparentBackground.
36         (-[WKView isOpaque]): Return drawsBackground.
37         * UIProcess/WebPageProxy.cpp:
38         (WebKit::WebPageProxy::WebPageProxy): Initialize m_drawsBackground and m_drawsTransparentBackground.
39         (WebKit::WebPageProxy::setDrawsBackground): Added. Send a SetDrawsBackground message.
40         (WebKit::WebPageProxy::setDrawsTransparentBackground): Added. Send a SetDrawsTransparentBackground message.
41         (WebKit::WebPageProxy::creationParameters): Set drawsBackground and drawsTransparentBackground.
42         * UIProcess/WebPageProxy.h:
43         (WebKit::WebPageProxy::drawsBackground): Added. Return m_drawsBackground.
44         (WebKit::WebPageProxy::drawsTransparentBackground): Added. Return m_drawsTransparentBackground.
45         * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
46         (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint): Use the copy blend mode when drawing a background.
47         (WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore): Use the copy blend mode to replace existing content.
48         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
49         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Setup the new view's background color and transparent flag.
50         * WebProcess/WebPage/WebPage.cpp:
51         (WebKit::WebPage::WebPage): Initialize m_drawsBackground and m_drawsTransparentBackground.
52         (WebKit::WebPage::setDrawsBackground): Added. Propagate the flag to the FrameViews.
53         (WebKit::WebPage::setDrawsTransparentBackground): Added. Propagate the background color to the FrameViews.
54         * WebProcess/WebPage/WebPage.h:
55         (WebKit::WebPage::drawsBackground): Added. Return m_drawsBackground.
56         (WebKit::WebPage::drawsTransparentBackground): Added. Return m_drawsTransparentBackground.
57         * WebProcess/WebPage/WebPage.messages.in: Added SetDrawsBackground and SetDrawsTransparentBackground.
58
59 2010-12-09  Anders Carlsson  <andersca@apple.com>
60
61         Reviewed by Sam Weinig.
62
63         Cannot use NSKeyedArchiver in WK2 for ResourceResponses
64         https://bugs.webkit.org/show_bug.cgi?id=50792
65         <rdar://problem/8741799>
66
67         When encoding, first convert the requests and responses to the serializable dictionary representation
68         and use the newly added CF CoreIPC encoders. When decoding, do the opposite.
69
70         * Shared/mac/WebCoreArgumentCodersMac.mm:
71         (CoreIPC::encodeResourceRequest):
72         (CoreIPC::decodeResourceRequest):
73         (CoreIPC::encodeResourceResponse):
74         (CoreIPC::decodeResourceResponse):
75
76 2010-12-09  Anders Carlsson  <andersca@apple.com>
77
78         Reviewed by Sam Weinig.
79
80         Add CoreIPC coders for CF types
81         https://bugs.webkit.org/show_bug.cgi?id=50791
82
83         * Platform/CoreIPC/ArgumentDecoder.h:
84         (CoreIPC::ArgumentDecoder::decodeEnum):
85         * Platform/CoreIPC/ArgumentEncoder.h:
86         (CoreIPC::ArgumentEncoder::encodeEnum):
87         * Shared/cf/ArgumentCodersCF.cpp: Added.
88         (CoreIPC::tokenNullTypeRef):
89         (CoreIPC::typeFromCFTypeRef):
90         (CoreIPC::encode):
91         (CoreIPC::decode):
92         (CoreIPC::sizeForNumberType):
93         * Shared/cf/ArgumentCodersCF.h: Added.
94         * WebKit2.xcodeproj/project.pbxproj:
95
96 2010-12-09  Brady Eidson  <beidson@apple.com>
97
98         Reviewed by Sam Weinig.
99
100         <rdar://problem/8749750> and https://bugs.webkit.org/show_bug.cgi?id=50786
101         WK2 authentication never consults WebCore session credential storage.
102
103         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
104         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage): Since we don't need to expose this as
105           API at this time, always return true.
106
107 2010-12-09  Sam Weinig  <weinig@apple.com>
108
109         Reviewed by Alexey Proskuryakov.
110
111         WebKit2: Add support for access keys
112         https://bugs.webkit.org/show_bug.cgi?id=49832
113
114         * WebProcess/WebPage/WebPage.cpp:
115         (WebKit::handleKeyEvent): Match windows WebKit and call
116         the event handler's for handleAccessKey function for
117         system keys. This will never be hit on the Mac.
118
119 2010-12-09  Darin Adler  <darin@apple.com>
120
121         Qt build fix.
122
123         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp: Include "NotImplemented.h".
124
125 2010-12-09  Steve Falkenburg  <sfalken@apple.com>
126
127         Windows build fix.
128         
129         * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp:
130
131 2010-12-09  Brady Eidson  <beidson@apple.com>
132
133         Reviewed by Anders Carlsson.
134
135         <rdar://problem/8613779> and https://bugs.webkit.org/show_bug.cgi?id=50777
136         WebKit2 ContextMenuClient support
137
138         Implement google search in a cross platform manner, and add a FIXME for download support:
139         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
140         (WebKit::WebContextMenuClient::downloadURL):
141         (WebKit::WebContextMenuClient::searchWithGoogle):
142
143         Mac implementations for speaking and searching:
144         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: Added.
145         (WebKit::WebContextMenuClient::lookUpInDictionary): Add a FIXME for now.
146         (WebKit::WebContextMenuClient::isSpeaking):
147         (WebKit::WebContextMenuClient::speak):
148         (WebKit::WebContextMenuClient::stopSpeaking):
149         (WebKit::WebContextMenuClient::searchWithSpotlight):
150
151         Stubs for Win and Qt:
152         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp: Added.
153         (WebKit::WebContextMenuClient::lookUpInDictionary):
154         (WebKit::WebContextMenuClient::isSpeaking):
155         (WebKit::WebContextMenuClient::speak):
156         (WebKit::WebContextMenuClient::stopSpeaking):
157         * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp: Added.
158         (WebKit::WebContextMenuClient::lookUpInDictionary):
159         (WebKit::WebContextMenuClient::isSpeaking):
160         (WebKit::WebContextMenuClient::speak):
161         (WebKit::WebContextMenuClient::stopSpeaking):
162
163         Project file stuffs:
164         * WebKit2.pro:
165         * WebKit2.xcodeproj/project.pbxproj:
166         * win/WebKit2.vcproj:
167
168 2010-12-09  Anders Carlsson  <andersca@apple.com>
169
170         Reviewed by Sam Weinig.
171
172         Don't leak the PDFDocument
173         https://bugs.webkit.org/show_bug.cgi?id=50771
174
175         * UIProcess/API/mac/PDFViewController.mm:
176         (WebKit::PDFViewController::setPDFDocumentData):
177
178 2010-12-09  Anders Carlsson  <andersca@apple.com>
179
180         Reviewed by Sam Weinig.
181
182         Add a basic implementation of PDF support on Mac
183         https://bugs.webkit.org/show_bug.cgi?id=50768
184
185         * UIProcess/API/mac/PDFViewController.h:
186         * UIProcess/API/mac/PDFViewController.mm: Added.
187         (-[WKPDFView initWithFrame:PDFViewController:WebKit::]):
188         Setup the view hierarchy.
189
190         (-[WKPDFView invalidate]):
191         Set the controller to null.
192
193         (-[WKPDFView pdfView]):
194         Return the PDF view.
195
196         (WebKit::PDFViewController::create):
197         (WebKit::PDFViewController::PDFViewController):
198         Create a WKPDFView and insert it as a subview of the WKView.
199
200         (WebKit::PDFViewController::~PDFViewController):
201         Remove the WKPDFView from the view hierarchy and invalidate it.
202
203         (WebKit::convertPostScriptDataSourceToPDF):
204         Convert the data in the data reference to PDF and return it as a CFDataRef.
205
206         (WebKit::PDFViewController::setPDFDocumentData):
207         Create a PDFDocument and set it on the PDF view.
208
209         (WebKit::PDFViewController::pdfDocumentClass):
210         (WebKit::PDFViewController::pdfPreviewViewClass):
211         (WebKit::PDFViewController::pdfKitBundle):
212         Add soft-linking helper functions.
213
214         * UIProcess/API/mac/PageClientImpl.mm:
215         (WebKit::PageClientImpl::didCommitLoadForMainFrame):
216         (WebKit::PageClientImpl::didFinishLoadingDataForCustomRepresentation):
217         Call the WKView methods.
218         
219         * UIProcess/API/mac/WKView.mm:
220         (-[WKView _setPageHasCustomRepresentation:]):
221         Create a PDF view controller if necessary.
222
223         (-[WKView _didFinishLoadingDataForCustomRepresentation:CoreIPC::]):
224         Pass the data along to the PDF view controller.
225
226         * WebKit2.xcodeproj/project.pbxproj:
227         Add new files.
228
229 2010-12-09  Anders Carlsson  <andersca@apple.com>
230
231         Reviewed by Sam Weinig.
232
233         Add support for custom representation
234         https://bugs.webkit.org/show_bug.cgi?id=50767
235
236         * Shared/WebProcessCreationParameters.cpp:
237         (WebKit::WebProcessCreationParameters::encode):
238         (WebKit::WebProcessCreationParameters::decode):
239         * Shared/WebProcessCreationParameters.h:
240         Add mimeTypesWithCustomRepresentation and encode and decode accordingly.
241
242         * UIProcess/API/mac/PageClientImpl.h:
243         * UIProcess/API/mac/PageClientImpl.mm:
244         (WebKit::PageClientImpl::didCommitLoadForMainFrame):
245         (WebKit::PageClientImpl::didFinishLoadingDataForCustomRepresentation):
246         Add empty stubs for now.
247
248         * UIProcess/API/qt/qwkpage.cpp:
249         (QWKPagePrivate::didCommitLoadForMainFrame):
250         (QWKPagePrivate::didFinishLoadingDataForCustomRepresentation):
251         * UIProcess/API/qt/qwkpage_p.h:
252         Add empty stubs.
253
254         * UIProcess/PageClient.h:
255         Add new functions for custom representations.
256
257         * UIProcess/WebFrameProxy.cpp:
258         (WebKit::WebFrameProxy::canShowMIMEType):
259         Check that the mime type is not null.
260
261         * UIProcess/WebPageProxy.cpp:
262         (WebKit::WebPageProxy::didCommitLoadForFrame):
263         This now takes an additional frameHasCustomRepresentation parameter. 
264         Call the page client function.
265
266         (WebKit::WebPageProxy::didFinishLoadingDataForCustomRepresentation):
267         Call the page client function.
268
269         * UIProcess/WebPageProxy.messages.in:
270         Change DidCommitLoadForFrame message, add DidFinishLoadingDataForCustomRepresentation message.
271
272         * UIProcess/mac/WebContextMac.mm:
273         (WebKit::WebContext::platformInitializeWebProcess):
274         We want to use custom representations for PDF and PostScript MIME types.
275
276         * UIProcess/win/WebView.cpp:
277         (WebKit::WebView::didCommitLoadForMainFrame):
278         (WebKit::WebView::didFinishLoadingDataForCustomRepresentation):
279         * UIProcess/win/WebView.h:
280         Add stubs.
281
282         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
283         (WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
284         Initialize m_frameHasCustomRepresentation.
285
286         (WebKit::WebFrameLoaderClient::hasHTMLView):
287         The frame has a HTML view unless it has a custom representation.
288
289         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
290         Pass along whether the frame has a custom representation.
291
292         (WebKit::WebFrameLoaderClient::committedLoad):
293         Don't send data back to WebCore if the frame has a custom representation.
294
295         (WebKit::WebFrameLoaderClient::finishedLoading):
296         Send all the data to the UI process.
297
298         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
299         Update the m_frameHasCustomRepresentation state based on the MIME type.
300
301         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
302         (WebKit::WebFrameLoaderClient::frameHasCustomRepresentation):
303         Add getter.
304
305         * WebProcess/WebPage/mac/ChunkedUpdateDrawingAreaMac.cpp:
306         (WebKit::ChunkedUpdateDrawingArea::paintIntoUpdateChunk):
307         Don't do any painting if the main frame has a custom representation.
308
309         * WebProcess/WebProcess.cpp:
310         (WebKit::WebProcess::initializeWebProcess):
311         Add all the MIME types with custom representations.
312
313         * WebProcess/WebProcess.h:
314         (WebKit::WebProcess::shouldUseCustomRepresentationForMIMEType):
315         Add getter.
316
317 2010-12-09  Maciej Stachowiak  <mjs@apple.com>
318
319         Reviewed by Dan Bernstein.
320
321         Implement "Use Selection for Find" in WebKit2
322         https://bugs.webkit.org/show_bug.cgi?id=50737
323         <rdar://problem/8564881>
324         
325         * UIProcess/API/mac/WKView.mm: Add support for the takeFindStringFromSelection:
326         selector as a command.
327
328 2010-12-09  Brady Eidson  <beidson@apple.com>
329
330         Reviewed by Maciej Stachowiak.
331
332         <rdar://problem/7660733> and https://bugs.webkit.org/show_bug.cgi?id=50191
333         WebKit2 Authentication Support
334
335         Implement authentication-related coders:
336         * Shared/WebCoreArgumentCoders.h:
337
338         Allow the ResourceResponse coders to handle null responses:
339         * Shared/mac/WebCoreArgumentCodersMac.mm:
340         (CoreIPC::encodeResourceResponse):
341         (CoreIPC::decodeResourceResponse):
342
343         Add new API and Impl casts for ProtectionSpace and Credential enums:
344         * UIProcess/API/C/WKAPICast.h:
345         (WebKit::toAPI):
346         (WebKit::toCredentialPersistence):
347
348         Move the DecisionListener to be accessed off the challenge itself, and fill in other
349         necessary API:
350         * UIProcess/API/C/WKAuthenticationChallenge.cpp:
351         (WKAuthenticationChallengeGetDecisionListener):
352         (WKAuthenticationChallengeGetProtectionSpace):
353         (WKAuthenticationChallengeGetProposedCredential):
354         (WKAuthenticationChallengeGetPreviousFailureCount):
355         * UIProcess/API/C/WKAuthenticationChallenge.h:
356         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
357         (WebKit::AuthenticationChallengeProxy::~AuthenticationChallengeProxy):
358         (WebKit::AuthenticationChallengeProxy::proposedCredential):
359         (WebKit::AuthenticationChallengeProxy::protectionSpace):
360         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
361         (WebKit::AuthenticationChallengeProxy::previousFailureCount):
362
363         Fill in some credential API:
364         * UIProcess/API/C/WKCredential.cpp:
365         (WKCredentialCreate):
366         (WKCredentialCopyUser):
367         * UIProcess/API/C/WKCredential.h:
368         * UIProcess/API/C/WKCredentialTypes.h: Added.
369         * UIProcess/Authentication/WebCredential.cpp:
370         (WebKit::WebCredential::WebCredential):
371         (WebKit::WebCredential::user):
372         * UIProcess/Authentication/WebCredential.h:
373         (WebKit::WebCredential::create):
374
375         Fill in some protection space API:
376         * UIProcess/API/C/WKProtectionSpace.cpp:
377         (WKProtectionSpaceCopyHost):
378         (WKProtectionSpaceGetPort):
379         (WKProtectionSpaceCopyRealm):
380         (WKProtectionSpaceGetIsProxy):
381         (WKProtectionSpaceGetServerType):
382         (WKProtectionSpaceGetReceivesCredentialSecurely):
383         (WKProtectionSpaceGetAuthenticationScheme):
384         * UIProcess/API/C/WKProtectionSpace.h:
385         * UIProcess/API/C/WKProtectionSpaceTypes.h: Added.
386         * UIProcess/Authentication/WebProtectionSpace.cpp:
387         (WebKit::WebProtectionSpace::WebProtectionSpace):
388         (WebKit::WebProtectionSpace::host):
389         (WebKit::WebProtectionSpace::port):
390         (WebKit::WebProtectionSpace::realm):
391         (WebKit::WebProtectionSpace::isProxy):
392         (WebKit::WebProtectionSpace::serverType):
393         (WebKit::WebProtectionSpace::receivesCredentialSecurely):
394         (WebKit::WebProtectionSpace::authenticationScheme):
395         * UIProcess/Authentication/WebProtectionSpace.h:
396
397         Change the authentication challenge callback to reflect the new ownership of
398         the DecisionListener:
399         * UIProcess/API/C/WKPage.h:
400         * UIProcess/WebLoaderClient.cpp:
401         (WebKit::WebLoaderClient::didReceiveAuthenticationChallengeInFrame):
402         * UIProcess/WebLoaderClient.h:
403         * UIProcess/WebPageProxy.cpp:
404         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge):
405
406         * WebKit2.pro:
407         * WebKit2.xcodeproj/project.pbxproj:
408         * win/WebKit2.vcproj:
409         * win/WebKit2Generated.make:
410
411 2010-12-08  Sam Weinig  <sam@webkit.org>
412
413         Reviewed by Geoffrey "Error" Garen.
414
415         Fix typo: Diplaying -> Displaying
416
417         * UIProcess/API/C/WKFrame.cpp:
418         (WKFrameIsDisplayingStandaloneImageDocument):
419         (WKFrameIsDisplayingMarkupDocument):
420         * UIProcess/API/C/WKFrame.h:
421         * UIProcess/WebFrameProxy.cpp:
422         (WebKit::WebFrameProxy::canProvideSource):
423         (WebKit::WebFrameProxy::isDisplayingStandaloneImageDocument):
424         (WebKit::WebFrameProxy::isDisplayingMarkupDocument):
425         * UIProcess/WebFrameProxy.h:
426
427 2010-12-08  Sam Weinig  <sam@webkit.org>
428
429         Reviewed by Gavin Barraclough.
430
431         Add WebKit2 Preference for TabsToLinks behavior.
432         <rdar://problem/8664263>
433
434         * Shared/WebPreferencesStore.h:
435         * UIProcess/API/C/WKPreferences.cpp:
436         (WKPreferencesSetTabsToLinks):
437         (WKPreferencesGetTabsToLinks):
438         * UIProcess/API/C/WKPreferences.h:
439         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
440         (WebKit::WebChromeClient::tabsToLinks):
441         * WebProcess/WebPage/WebPage.cpp:
442         (WebKit::WebPage::WebPage):
443         (WebKit::WebPage::updatePreferences):
444         * WebProcess/WebPage/WebPage.h:
445         (WebKit::WebPage::tabsToLinks):
446
447 2010-12-08  Benjamin Poulain  <benjamin.poulain@nokia.com>
448
449         Reviewed by Andreas Kling.
450
451         WebTouchEvent::isTouchEventType() does not take into account the type TouchCancel
452         https://bugs.webkit.org/show_bug.cgi?id=50680
453
454         Add the missing type check to WebTouchEvent::isTouchEventType().
455
456         * Shared/WebTouchEvent.cpp:
457         (WebKit::WebTouchEvent::isTouchEventType):
458
459 2010-12-08  Sam Weinig  <sam@webkit.org>
460
461         Reviewed by Darin Adler.
462
463         Need a way to get a WKBundleFrameRef from JS HTMLIFrameElement
464         https://bugs.webkit.org/show_bug.cgi?id=50726
465
466         Adds WKBundleNodeHandleCopyDocumentFrame, WKBundleNodeHandleCopyHTMLFrameElementContentFrame
467         and WKBundleNodeHandleCopyHTMLIFrameElementContentFrame, to handle the document, <frame>
468         and <iframe> cases.
469
470         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
471         (WKBundleNodeHandleCopyDocumentFrame):
472         (WKBundleNodeHandleCopyHTMLFrameElementContentFrame):
473         (WKBundleNodeHandleCopyHTMLIFrameElementContentFrame):
474         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
475         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
476         (WebKit::InjectedBundleNodeHandle::copyDocumentFrame):
477         (WebKit::InjectedBundleNodeHandle::copyHTMLFrameElementContentFrame):
478         (WebKit::InjectedBundleNodeHandle::copyHTMLIFrameElementContentFrame):
479         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
480
481 2010-12-08  Sam Weinig  <sam@webkit.org>
482
483         Reviewed by Gavin Barraclough.
484
485         Need a WebKit2 way to test whether a frame is displaying a standalone image
486         <rdar://problem/8443059>
487         WebKit2: Need a way to test whether a page or frame is showing HTML content
488         <rdar://problem/8642563>
489
490         Add WKFrameIsDiplayingStandaloneImageDocument and WKFrameIsDiplayingMarkupDocument.
491
492         * UIProcess/API/C/WKFrame.cpp:
493         (WKFrameIsDiplayingStandaloneImageDocument):
494         (WKFrameIsDiplayingMarkupDocument):
495         * UIProcess/API/C/WKFrame.h:
496         * UIProcess/WebFrameProxy.cpp:
497         (WebKit::WebFrameProxy::canProvideSource): This now just calls isDiplayingMarkupDocument.
498         (WebKit::WebFrameProxy::isDiplayingStandaloneImageDocument):
499         (WebKit::WebFrameProxy::isDiplayingMarkupDocument):
500         * UIProcess/WebFrameProxy.h:
501
502 2010-12-08  Anders Carlsson  <andersca@apple.com>
503
504         Reviewed by Darin Adler.
505
506         WebFrameProxy::canShowMIMEType should return true for PDF MIME types in the main frame
507         https://bugs.webkit.org/show_bug.cgi?id=50724
508
509         * UIProcess/WebContext.cpp:
510         (WebKit::WebContext::pdfAndPostScriptMIMETypes):
511         * UIProcess/WebContext.h:
512         * UIProcess/WebFrameProxy.cpp:
513         (WebKit::WebFrameProxy::canShowMIMEType):
514
515 2010-12-08  Brian Weinstein  <bweinstein@apple.com>
516
517         Reviewed by Brady Eidson.
518
519         WebMenuTarget implemented in both WebKit and WebKit2
520         https://bugs.webkit.org/show_bug.cgi?id=50665
521         <rdar://problem/8742640>
522         
523         Rename WebMenuTarget to WKMenuTarget to prevent this warning and stay consistent with
524         other WebKit2 namings.
525
526         * UIProcess/mac/WebContextMenuProxyMac.mm:
527         (+[WKMenuTarget sharedMenuTarget]):
528         (WebKit::nsMenuItemVector):
529         (WebKit::WebContextMenuProxyMac::showContextMenu):
530
531 2010-12-08  Anders Carlsson  <andersca@apple.com>
532
533         Reviewed by Sam Weinig.
534
535         Move canShowMIMEType to Frame
536         https://bugs.webkit.org/show_bug.cgi?id=50723
537
538         * UIProcess/API/C/WKFrame.cpp:
539         (WKFrameCanShowMIMEType):
540         * UIProcess/API/C/WKFrame.h:
541         * UIProcess/API/C/WKPage.cpp:
542         * UIProcess/API/C/WKPage.h:
543         * UIProcess/WebFrameProxy.cpp:
544         (WebKit::WebFrameProxy::canShowMIMEType):
545         * UIProcess/WebFrameProxy.h:
546
547 2010-12-08  Sam Weinig  <sam@webkit.org>
548
549         Reviewed by Oliver Hunt.
550
551         Rename WKPreferencesGetFTPDirectoryTemplatePath to WKPreferencesCopyFTPDirectoryTemplatePath
552         since it copies the value.
553
554         * UIProcess/API/C/WKPreferences.cpp:
555         (WKPreferencesCopyFTPDirectoryTemplatePath):
556         * UIProcess/API/C/WKPreferencesPrivate.h:
557
558 2010-12-08  Sam Weinig  <sam@webkit.org>
559
560         Reviewed by Brady Eidson.
561
562         WebKit2: Can't open ftp directory
563         <rdar://problem/8489321>
564
565         * Shared/WebPreferencesStore.h:
566         * UIProcess/API/C/WKPreferences.cpp:
567         (WKPreferencesSetForceFTPDirectoryListings):
568         (WKPreferencesGetForceFTPDirectoryListings):
569         (WKPreferencesSetFTPDirectoryTemplatePath):
570         (WKPreferencesGetFTPDirectoryTemplatePath):
571         * UIProcess/API/C/WKPreferencesPrivate.h:
572         * WebProcess/WebPage/WebPage.cpp:
573         (WebKit::WebPage::updatePreferences):
574         Pipe through the FTP directory listing preferences.
575
576 2010-12-08  Chris Marrin  <cmarrin@apple.com>
577
578         Reviewed by Simon Fraser.
579
580         Share code between Mac (CA) and Windows (CACF) GraphicsLayer implementations
581         https://bugs.webkit.org/show_bug.cgi?id=49388
582
583         Fixes a build failure because WebChromeClient.cpp uses WebCore::Cursor.
584         This patch adds an include of QuartzCore/CATransform3D, which includes
585         a file that has a 'Cursor' object defined. So I had to qualify the
586         use of Cursor in WebChromeClient.cpp.
587
588         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
589         (WebKit::WebChromeClient::setCursor):
590
591 2010-12-07  Brian Weinstein  <bweinstein@apple.com>
592
593         Reviewed by John Sullivan.
594
595         Layering Violation in ContextMenu - member variable of type HitTestResult
596         https://bugs.webkit.org/show_bug.cgi?id=50586
597         
598         Update users of ContextMenu and ContextMenuController to match where the new functions 
599         are located.
600
601         * Shared/WebContextMenuItemData.cpp:
602         (WebKit::WebContextMenuItemData::WebContextMenuItemData): Remove the call to checkOrEnableItem, that call will be made when
603             the ContextMenuItem is added to the ContextMenu through the ContextMenuController.
604         * WebProcess/WebPage/WebContextMenu.cpp:
605         (WebKit::WebContextMenu::show):
606
607 2010-12-08  Jessie Berlin  <jberlin@apple.com>
608
609         Reviewed by Adam Roben.
610
611         WebKit2: Implement WebChromeClient::exceededDatabaseQuota
612         https://bugs.webkit.org/show_bug.cgi?id=50656
613
614         The exceededDatabaseQuota call from the WebProcess to the UIProcess needs to be synchronous
615         because the new quota is checked directly after exceededDatabaseQuota returns in order to
616         determine if the new Database can be created.
617
618         Pass all of the details from the WebProcess to the UIProcess in order to inform the
619         decision in the UIProcess about the new quota. In WebKit1, these details were
620         fetched through an additional call to the API detailsForDatabase (which is infeasible in
621         WebKit2 since exceededDatabaseQuota is a synchronous call).
622
623         * Platform/CoreIPC/HandleMessage.h:
624         (CoreIPC::callMemberFunction):
625         Add a version that takes 7 parameters.
626
627         * UIProcess/API/C/WKPage.h:
628
629         * UIProcess/API/qt/qwkpage.cpp:
630         (QWKPage::QWKPage):
631         Indicate that exceededDatabaseQuota is not implemented.
632
633         * UIProcess/WebPageProxy.cpp:
634         (WebKit::WebPageProxy::exceededDatabaseQuota):
635         Call the UIClient's exceededDatabaseQuota
636         * UIProcess/WebPageProxy.h:
637         * UIProcess/WebPageProxy.messages.in:
638
639         * UIProcess/WebUIClient.cpp:
640         (WebKit::WebUIClient::exceededDatabaseQuota):
641         If the client does not implement exceededDatabaseQuota, return a the current quota.
642         * UIProcess/WebUIClient.h:
643
644         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
645         (WebKit::WebChromeClient::exceededDatabaseQuota):
646         Send a synchronous message to the UIProcess to ask for the new quota for the origin for the
647         given frame.
648
649 2010-12-07  Anders Carlsson  <andersca@apple.com>
650
651         Reviewed by Sam Weinig.
652
653         fast/loader/empty-embed-src-attribute.html asserts in debug builds
654         https://bugs.webkit.org/show_bug.cgi?id=50643
655
656         Just always ignore attempts to load requests with empty URLs.
657
658         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
659         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
660
661 2010-12-07  Jessie Berlin  <jberlin@apple.com>
662
663         Build fix. Unreviewed.
664
665         * WebKit2.pro:
666         Added WebDatabaseManagerQt.cpp.
667         * WebProcess/WebCoreSupport/qt/WebDatabaseManagerQt.cpp: Added.
668         (WebKit::WebDatabaseManager::databaseDirectory):
669         Added a FIXME to implement and return an empty string.
670
671 2010-12-07  Darin Adler  <darin@apple.com>
672
673         Get a bit closer to making Qt WebKit2 compile again.
674
675         * WebKit2.pro: Add the WebDatabaseManager source files.
676         Still missing: The Qt version of the databaseDirectory function.
677
678 2010-12-07  Jessie Berlin  <jberlin@apple.com>
679
680         Reviewed by Darin Adler.
681
682         WebKit2: Need to set the location of the Databases directory when the WebProcess is initialized
683         https://bugs.webkit.org/show_bug.cgi?id=50604
684
685         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp: Added.
686         (WebKit::WebDatabaseManager::shared):
687         (WebKit::WebDatabaseManager::WebDatabaseManager):
688         Initialize the DatabaseTracker with the Database directory.
689         * WebProcess/WebCoreSupport/WebDatabaseManager.h: Added.
690         * WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm: Added.
691         (WebKit::WebDatabaseManager::databaseDirectory):
692         Copied from WebKitInitializeDatabasesIfNecessary in WebKit/mac/Storage/WebDatabaseManager.mm.
693         * WebProcess/WebCoreSupport/win/WebDatabaseManagerWin.cpp: Added.
694         (WebKit::WebDatabaseManager::databaseDirectory):
695         Copied from WebKitInitializeWebDatabasesIfNecessary in WebKit/win/WebDatabaseManager.cpp.
696
697         * WebProcess/WebProcess.cpp:
698         (WebKit::WebProcess::WebProcess):
699         Make sure that the Databases directory has been set by calling WebDatabaseManager::shared().
700
701         * WebKit2.xcodeproj/project.pbxproj:
702         Add WebDatabaseManager.cpp/.h/Mac.cpp
703         * win/WebKit2.vcproj:
704         Add WebDatabaseManager.cpp/.h/Win.cpp
705
706 2010-12-06  Darin Adler  <darin@apple.com>
707
708         Reviewed by Sam Weinig.
709
710         Pass security origin to make local file decision correctly
711         https://bugs.webkit.org/show_bug.cgi?id=48603
712
713         * WebProcess/Plugins/PluginView.cpp:
714         (WebKit::PluginView::loadURL): Pass security origin.
715         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
716         (WebKit::WebFrameLoaderClient::dispatchCreatePage): Ditto.
717
718 2010-12-06  Simon Fraser  <simon.fraser@apple.com>
719
720         Reviewed by Sam Weinig.
721
722         Fix two WebKit2 prefs issues.
723
724         * Shared/WebPreferencesStore.h: Include font-family preferences
725         in the FOR_EACH_WEBKIT_STRING_PREFERENCE macro, actually propagating
726         font family prefs to WebCore settings.
727         
728         * UIProcess/WebPageGroup.cpp:
729         (WebKit::WebPageGroup::WebPageGroup):
730         (WebKit::WebPageGroup::~WebPageGroup): Add and remove the WebPageGroup
731         from the preference object it creates. This allows preference changes
732         to actually be propagated to the web process.
733
734 2010-12-06  Anders Carlsson  <andersca@apple.com>
735
736         Reviewed by Sam Weinig.
737
738         The plug-in process crashes if it can't load the plug-in module
739         https://bugs.webkit.org/show_bug.cgi?id=50601
740         <rdar://problem/8692654>
741
742         * PluginProcess/PluginControllerProxy.cpp:
743         (WebKit::PluginControllerProxy::initialize):
744         Handle m_plugin being 0.
745
746         * PluginProcess/PluginProcess.cpp:
747         (WebKit::PluginProcess::netscapePluginModule):
748         Create the plug-in module if it doesn't exist.
749
750         (WebKit::PluginProcess::initialize):
751         Store the plug-in path.
752
753         * PluginProcess/PluginProcess.h:
754         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
755         (WebKit::NetscapePlugin::create):
756         Return null if the plug-in module doesn't exist.
757
758         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
759         * WebProcess/WebPage/WebPage.cpp:
760         (WebKit::WebPage::createPlugin):
761         Simplify code.
762
763 2010-12-06  Anders Carlsson  <andersca@apple.com>
764
765         Reviewed by Sam Weinig.
766
767         WebProcess crash in NPRemoteObjectMap::invalidate when closing tab
768         https://bugs.webkit.org/show_bug.cgi?id=50597
769         <rdar://problem/8655584>
770
771         When invalidating the NPRemoteObjectMap, we don't want NPObjectMessageReceiver to
772         release all objects NPObjects blindly because NPJSObjects have already been deallocated by the plug-in view.
773
774         This is not an ideal solution; an ideal solution would involve NPJSObjects notifying any NPObjectMessageReceiver objects
775         that the NPJSObject is being destroyed. The NPObjectMessageReceiver could then simply null out the NPObject pointer.
776
777         * Shared/Plugins/NPObjectMessageReceiver.cpp:
778         (WebKit::NPObjectMessageReceiver::NPObjectMessageReceiver):
779         (WebKit::NPObjectMessageReceiver::~NPObjectMessageReceiver):
780         * Shared/Plugins/NPObjectMessageReceiver.h:
781         * Shared/Plugins/NPRemoteObjectMap.cpp:
782         (WebKit::NPRemoteObjectMap::NPRemoteObjectMap):
783         (WebKit::NPRemoteObjectMap::invalidate):
784         * Shared/Plugins/NPRemoteObjectMap.h:
785         (WebKit::NPRemoteObjectMap::isInvalidating):
786
787 2010-12-06  Sam Weinig  <sam@webkit.org>
788
789         Reviewed by Anders Carlsson.
790
791         Generalize didChangeLocationWithinPageForFrame for all same document navigations
792         https://bugs.webkit.org/show_bug.cgi?id=50584
793
794           - Rename didChangeLocationWithinPageForFrame callbacks to didSameDocumentNavigationForFrame
795           - Add WKSameDocumentNavigationType to didChangeLocationWithinPageForFrame.
796           - Call didSameDocumentNavigationForFrame for HTML session state changes.
797
798         * Shared/API/c/WKPageLoadTypes.h: Added.
799         * Shared/API/c/WKSharedAPICast.h:
800         (WebKit::toAPI):
801         Moved WKFrameNavigationType here from WKPage.h and add WKSameDocumentNavigationType.
802
803         * Shared/SameDocumentNavigationType.h: Added.
804         * UIProcess/API/C/WKAPICast.h:
805         Moved WKFrameNavigationType conversion from here.
806
807         * UIProcess/API/C/WKPage.h:
808         * UIProcess/API/qt/qwkpage.cpp:
809         (QWKPage::QWKPage):
810         Update comment.
811
812         * UIProcess/WebFrameProxy.cpp:
813         (WebKit::WebFrameProxy::didSameDocumentNavigation):
814         * UIProcess/WebFrameProxy.h:
815         * UIProcess/WebLoaderClient.cpp:
816         (WebKit::WebLoaderClient::didSameDocumentNavigationForFrame):
817         * UIProcess/WebLoaderClient.h:
818         * UIProcess/WebPageProxy.cpp:
819         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
820         * UIProcess/WebPageProxy.h:
821         * UIProcess/WebPageProxy.messages.in:
822         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
823         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
824         (WebKit::InjectedBundlePageLoaderClient::didSameDocumentNavigationForFrame):
825         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
826         Pipe new name through.
827
828         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
829         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
830         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
831         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
832         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
833         Call didChangeLocationWithinPageForFrame for session state changes.
834
835         * WebKit2.pro:
836         * WebKit2.xcodeproj/project.pbxproj:
837         * win/WebKit2.vcproj:
838         * win/WebKit2Generated.make:
839         Add new files.
840
841 2010-12-06  Jessie Berlin  <jberlin@apple.com>
842
843         Reviewed by Dan Bernstein.
844
845         WebKit2: Expose the preference to enable or disable HTML5 Databases.
846         https://bugs.webkit.org/show_bug.cgi?id=50411
847
848         * Shared/WebPreferencesStore.h:
849         Make the preference to enable HTML5 Databases default ot true.
850
851         * UIProcess/API/C/WKPreferences.cpp:
852         (WKPreferencesSetDatabasesEnabled):
853         (WKPreferencesGetDatabasesEnabled):
854         * UIProcess/API/C/WKPreferences.h:
855
856         * WebProcess/WebPage/WebPage.cpp:
857         (WebKit::WebPage::updatePreferences):
858         Set AbstractDatabase::isAvailable (mimicking how the preference is set in WebKit1).
859
860 2010-12-06  Mark Rowe  <mrowe@apple.com>
861
862         Build fix.
863
864         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
865         (WebKit::NetscapePlugin::platformHandleKeyboardEvent): Wrap Carbon-specific code in #ifndef NP_NO_CARBON.
866
867 2010-12-06  Anders Carlsson  <andersca@apple.com>
868
869         Reviewed by Adam Roben.
870
871         Add a shim for GetCurrentEventButtonState
872         https://bugs.webkit.org/show_bug.cgi?id=50583
873
874         * PluginProcess/mac/PluginProcessMac.mm:
875         (WebKit::getCurrentEventButtonState):
876         Get the event button state from the plug-in.
877
878         (WebKit::PluginProcess::initializeShim):
879         Add new shim callback.
880
881         * PluginProcess/mac/PluginProcessShim.cpp:
882         (WebKit::shimGetCurrentEventButtonState):
883         Add shim.
884
885         * PluginProcess/mac/PluginProcessShim.h:
886         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
887         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
888         (WebKit::NetscapePlugin::buttonState):
889         Return the button state.
890
891         (WebKit::NetscapePlugin::platformHandleMouseEvent):
892         Update the button state. Also, make sure to actually pass the modifiers to NPP_HandleEvent.
893         
894
895 2010-12-06  Anders Carlsson  <andersca@apple.com>
896
897         Reviewed by Adam Roben.
898
899         Add a shim for IsWindowActive
900         https://bugs.webkit.org/show_bug.cgi?id=50582
901
902         * PluginProcess/mac/PluginProcessMac.mm:
903         (WebKit::isWindowActive):
904         Get the NetscapePlugin from the WindowRef and check if the plug-in's window is active.
905
906         (WebKit::PluginProcess::initializeShim):
907         * PluginProcess/mac/PluginProcessShim.cpp        
908         (WebKit::shimIsWindowActive):
909         Call isWindowActive. If it returns true, return the result value. Otherwise, call the real
910         IsWindowActive function.
911
912         * PluginProcess/mac/PluginProcessShim.h:
913         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
914         (WebKit::NetscapePlugin::NetscapePlugin):
915         Initialize m_isWindowactive.
916
917         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
918         (WebKit::NetscapePlugin::isWindowActive):
919         Return whether the window is active.
920
921         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
922         (WebKit::windowMap):
923         (WebKit::NetscapePlugin::platformPostInitialize):
924         (WebKit::NetscapePlugin::platformDestroy):
925         (WebKit::NetscapePlugin::netscapePluginFromWindow):
926         Add a mapping between windows and the corresponding NetscapePlugin objects.
927
928         (WebKit::NetscapePlugin::windowFocusChanged):
929         Update the window focus member variable.
930
931 2010-12-06  Anders Carlsson  <andersca@apple.com>
932
933         Reviewed by Dan Bernstein.
934
935         REGERSSION (r73310?): Contents of <select> popup menus are upside-down on Windows
936         https://bugs.webkit.org/show_bug.cgi?id=50544
937         <rdar://problem/8732336>
938
939         * Shared/BackingStore.cpp:
940         * Shared/BackingStore.h:
941         * Shared/cairo/BackingStoreCairo.cpp:
942         Remove BackingStore::createFlippedGraphicsContext.
943
944         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
945         (WebKit::WebPopupMenu::setUpPlatformData):
946         Don't create a flipped graphics context.
947
948 2010-12-06  Anders Carlsson  <andersca@apple.com>
949
950         Reviewed by Dan Bernstein.
951
952         REGRESSION: Text in Find indicator is vertically flipped
953         https://bugs.webkit.org/show_bug.cgi?id=50524
954         <rdar://problem/8732978>
955
956         Don't flip the graphics context.
957
958         * UIProcess/FindIndicator.cpp:
959         (WebKit::FindIndicator::draw):
960
961 2010-12-03  Anders Carlsson  <andersca@apple.com>
962
963         Reviewed by Sam Weinig.
964
965         Dispatch keyboard events in the Carbon event model
966         https://bugs.webkit.org/show_bug.cgi?id=50503
967
968         * Shared/WebEvent.h:
969         (WebKit::WebKeyboardEvent::macCharCode):
970         * Shared/WebKeyboardEvent.cpp:
971         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
972         (WebKit::WebKeyboardEvent::encode):
973         (WebKit::WebKeyboardEvent::decode):
974         Add macCharCode field.
975
976         * Shared/mac/WebEventFactory.mm:
977         (WebKit::WebEventFactory::createWebKeyboardEvent):
978         * Shared/qt/WebEventFactoryQt.cpp:
979         (WebKit::WebEventFactory::createWebKeyboardEvent):
980         * Shared/win/WebEventFactory.cpp:
981         (WebKit::WebEventFactory::createWebKeyboardEvent):
982         Pass along the Mac char code.
983         
984         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
985         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
986         Convert the event to a Carobn event.
987
988 2010-12-03  John Sullivan  <sullivan@apple.com>
989
990         Reviewed by Adam Roben.
991
992         https://bugs.webkit.org/show_bug.cgi?id=50504
993         Expose some more WebCore settings in WebKit2 preferences
994
995         * Shared/WebPreferencesStore.h:
996         Changed name of existing FOR_EACH_WEBKIT_STRING_PREFERENCE macro to
997         FOR_EACH_WEBKIT_FONT_FAMILY_PREFERENCE since it was all about platform-specific
998         font families, and I'm now introducing a non-platform-spacific string, and
999         I didn't want to put the new preference in two platform-specific lists. Then
1000         added a new FOR_EACH_WEBKIT_STRING_PREFERENCE to hold the new preference. Note
1001         that the other preferences exposed in this patch were already declared here.
1002         
1003         * UIProcess/API/C/WKPreferences.cpp:
1004         (WKPreferencesSetDefaultFontSize):
1005         New wrapper.
1006         (WKPreferencesGetDefaultFontSize):
1007         Ditto.
1008         (WKPreferencesSetDefaultFixedFontSize):
1009         Ditto.
1010         (WKPreferencesGetDefaultFixedFontSize):
1011         Ditto.
1012         (WKPreferencesSetDefaultTextEncodingName):
1013         Ditto.
1014         (WKPreferencesCopyDefaultTextEncodingName):
1015         Ditto.
1016         
1017         * UIProcess/API/C/WKPreferences.h:
1018         Declare new wrappers.
1019
1020 2010-12-05  Adam Roben  <aroben@apple.com>
1021
1022         Windows production build fix
1023
1024         Put spaces after trailing backslashes when setting
1025         %WebKitVSPropsRedirectionDir%. According to MSDN
1026         <http://msdn.microsoft.com/en-us/library/2kzfk8c7(v=VS.80).aspx>:
1027
1028            A backslash ( \ ) followed by a newline character is interpreted as
1029            a space in the command; use a backslash at the end of a line to
1030            continue a command onto the next line. NMAKE interprets the
1031            backslash literally if any other character, including a space or
1032            tab, follows the backslash.
1033
1034         * win/WebKit2.make:
1035
1036 2010-12-04  Sam Weinig  <sam@webkit.org>
1037
1038         Reviewed by Jon Honeycutt.
1039
1040         WebKit2: Need client functions to notify app when the url changes due to a fragment navigation
1041         https://bugs.webkit.org/show_bug.cgi?id=50511
1042
1043         Pipe didChangeLocationWithinPageForFrame up through the UIProcess to the WKPageLoadClient,
1044         updating the WebFrameProxy's URL on the way.
1045
1046         Test: PageLoadDidChangeLocationWithinPageForFrame
1047
1048         * UIProcess/API/C/WKPage.h:
1049         * UIProcess/API/qt/qwkpage.cpp:
1050         (QWKPage::QWKPage):
1051         * UIProcess/WebFrameProxy.cpp:
1052         (WebKit::WebFrameProxy::didChangeURLWithoutNavigation):
1053         * UIProcess/WebFrameProxy.h:
1054         * UIProcess/WebLoaderClient.cpp:
1055         (WebKit::WebLoaderClient::didChangeLocationWithinPageForFrame):
1056         * UIProcess/WebLoaderClient.h:
1057         * UIProcess/WebPageProxy.cpp:
1058         (WebKit::WebPageProxy::didChangeLocationWithinPageForFrame):
1059         * UIProcess/WebPageProxy.h:
1060         * UIProcess/WebPageProxy.messages.in:
1061         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1062         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1063         (WebKit::InjectedBundlePageLoaderClient::didChangeLocationWithinPageForFrame):
1064         (WebKit::InjectedBundlePageLoaderClient::didDisplayInsecureContentForFrame):
1065         (WebKit::InjectedBundlePageLoaderClient::didRunInsecureContentForFrame):
1066         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1067         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1068         (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect): Fix typo.
1069         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
1070
1071 2010-12-03  Timothy Hatcher  <timothy@apple.com>
1072
1073         Make the Web Inspector window show and be usable on Mac.
1074
1075         https://webkit.org/b/50490
1076
1077         Reviewed by Sam Weinig.
1078
1079         * UIProcess/WebInspectorProxy.cpp:
1080         (WebKit::WebInspectorProxy::invalidate): Call platformClose.
1081         (WebKit::WebInspectorProxy::didLoadInspectorPage): Call platformOpen.
1082         (WebKit::WebInspectorProxy::didClose): Call platformClose.
1083         * UIProcess/WebInspectorProxy.h:
1084         * UIProcess/WebInspectorProxy.messages.in: Added DidClose.
1085         * UIProcess/mac/WebInspectorProxyMac.mm:
1086         (-[WebInspectorProxyObjCAdapter initWithWebInspectorProxy:]): Added.
1087         (-[WebInspectorProxyObjCAdapter windowWillClose:]): Added. Call WebInspectorProxy::close.
1088         (WebKit::WebInspectorProxy::platformOpen): Added.
1089         (WebKit::WebInspectorProxy::platformClose): Added.
1090         * UIProcess/qt/WebInspectorProxyQt.cpp:
1091         (WebKit::WebInspectorProxy::platformOpen): Added stub.
1092         (WebKit::WebInspectorProxy::platformClose): Added stub.
1093         * UIProcess/win/WebInspectorProxyWin.cpp:
1094         (WebKit::WebInspectorProxy::platformOpen): Added stub.
1095         (WebKit::WebInspectorProxy::platformClose): Added stub.
1096         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1097         (WebKit::WebInspectorClient::sendMessageToFrontend): Added more null checks to avoid a crash.
1098         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
1099         (WebKit::WebInspectorFrontendClient::closeWindow): Call WebInspector::didClose.
1100         (WebKit::WebInspectorFrontendClient::disconnectFromBackend): Ditto.
1101         (WebKit::WebInspectorFrontendClient::sendMessageToBackend): Removed. This does not need to be
1102         implemented by our subclass since we are in a single process.
1103         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.h: Removed sendMessageToBackend.
1104         * WebProcess/WebPage/WebInspector.cpp:
1105         (WebKit::WebInspector::didClose): Added. Send a DidClose message to the UI process.
1106         * WebProcess/WebPage/WebInspector.h:
1107
1108 2010-12-03  Anders Carlsson  <andersca@apple.com>
1109
1110         Reviewed by Sam Weinig and Dan Bernstein.
1111
1112         Clean up the BackingStore implementation
1113         https://bugs.webkit.org/show_bug.cgi?id=50498
1114
1115         * Shared/BackingStore.cpp:
1116         (WebKit::BackingStore::create):
1117         (WebKit::BackingStore::createSharable):
1118         (WebKit::BackingStore::resize):
1119         Use new numBytesForSize helper function.
1120
1121         (WebKit::BackingStore::createFlippedGraphicsContext):
1122         Make this function platform independent.
1123
1124         * Shared/BackingStore.h:
1125         (WebKit::BackingStore::numBytesForSize):
1126         Given a size, return the number of bytes needed for it.
1127
1128         (WebKit::BackingStore::sizeInBytes):
1129         Implement.
1130
1131         * Shared/cg/BackingStoreCG.cpp:
1132         (WebKit::BackingStore::paint):
1133         Don't use CGBitmapContextCreateImage; it creates an extra copy of the image data.
1134
1135         * Shared/qt/BackingStoreQt.cpp:
1136         Remove createFlippedGraphicsContext.
1137
1138 2010-12-03  Siddharth Mathur  <siddharth.mathur@nokia.com>
1139
1140         Reviewed by Laszlo Gombos.
1141
1142         [Qt] [WK2] Build system improvements for non-Unix targets
1143         https://bugs.webkit.org/show_bug.cgi?id=50257
1144
1145         * DerivedSources.pro:
1146         Fix dir seperator errors on Windows build host. Thanks to Laszlo Gombos.
1147
1148 2010-12-03  Sam Weinig  <sam@webkit.org>
1149
1150         Reviewed by Maciej Stachowiak.
1151
1152         Enable <a ping> for Mac/Windows/WebKit2 builds
1153         <rdar://problem/8504473>
1154         https://bugs.webkit.org/show_bug.cgi?id=50488
1155
1156         * Shared/WebPreferencesStore.h:
1157         * UIProcess/API/C/WKPreferences.cpp:
1158         (WKPreferencesSetHyperlinkAuditingEnabled):
1159         (WKPreferencesGetHyperlinkAuditingEnabled):
1160         * UIProcess/API/C/WKPreferences.h:
1161         Add "HyperlinkAuditing" preference and enabled it by default.
1162
1163 2010-12-03  Brady Eidson  <beidson@apple.com>
1164
1165         Reviewed by good sense in fixing builds.
1166
1167         Export the 4 new API headers I added today.
1168
1169         * WebKit2.xcodeproj/project.pbxproj:
1170
1171 2010-12-03  Brady Eidson  <beidson@apple.com>
1172
1173         Reviewed by Sam Weinig.
1174
1175         <rdar://problem/8725679> and https://bugs.webkit.org/show_bug.cgi?id=50482
1176         Crash trying to empty caches with no WebProcess.
1177
1178         * Shared/WebProcessCreationParameters.h: Add the "clear this cache" flags.
1179
1180         * UIProcess/WebContext.cpp:
1181         (WebKit::WebContext::WebContext):
1182         (WebKit::WebContext::ensureWebProcess): If either of the clear cache flags are set when a new WebProcess is
1183           created, include those flags in the parameters.
1184         (WebKit::WebContext::clearResourceCaches): If the current process isn't valid, flag this action to be done later.
1185         (WebKit::WebContext::clearApplicationCache): Ditto.
1186         * UIProcess/WebContext.h:
1187
1188         * WebProcess/WebProcess.cpp:
1189         (WebKit::WebProcess::initializeWebProcess): Clear the caches if told to.
1190
1191 2010-12-03  Sam Weinig  <sam@webkit.org>
1192
1193         Reviewed by Gavin Barraclough.
1194
1195         Fix failing API test. The default san serif font on the mac
1196         should be Helvetica, not Courier.
1197
1198         * Shared/WebPreferencesStore.h:
1199
1200 2010-12-03  Jia Pu  <jpu@apple.com>
1201
1202         Reviewed by Darin Adler.
1203
1204         Need to move all code that applies correction into correction panel callback.
1205         https://bugs.webkit.org/show_bug.cgi?id=50426
1206         <rdar://problem/8720832>
1207
1208         Adopted new signature of dismissCorrectionPanel.
1209
1210         * WebProcess/WebCoreSupport/WebEditorClient.h:
1211         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1212         (WebKit::WebEditorClient::dismissCorrectionPanel):
1213
1214 2010-12-03  Jessie Berlin  <jberlin@apple.com>
1215
1216         Windows build fix. Unreviewed.
1217
1218         * win/WebKit2Generated.make:
1219         Add the new API files from http://trac.webkit.org/changeset/73281.
1220
1221 2010-12-03  Brady Eidson  <beidson@apple.com>
1222
1223         Reviewed by Anders Carlsson.
1224
1225         Groundwork for <rdar://problem/7660733> and https://bugs.webkit.org/show_bug.cgi?id=50191
1226         WebKit2 Authentication Support
1227
1228         With this patch in place, authentication challenges are sent up from WebCore and shipped over the IPC layer.
1229         Client apps can implement the related client methods to attempt to continue without credentials or cancel a
1230         challenge.
1231
1232         There's not yet API to inspect a challenge or create a credential to use in reply - that will come later.
1233
1234         Build-system changes:
1235         * DerivedSources.make:
1236         * DerivedSources.pro:
1237         * WebKit2.pro:
1238         * WebKit2.xcodeproj/project.pbxproj:
1239         * win/WebKit2.vcproj:
1240         * win/WebKit2Common.vsprops:
1241
1242         Messages and casts for IPC and APIs:
1243         * Platform/CoreIPC/MessageID.h:
1244         * Shared/API/c/WKBase.h:
1245         * Shared/APIObject.h:
1246         * Shared/WebCoreArgumentCoders.h:
1247         * UIProcess/API/C/WKAPICast.h:
1248         * WebProcess/WebProcess.cpp:
1249         (WebKit::WebProcess::didReceiveMessage):
1250
1251         Stub out the AuthenticationChallenge class family:
1252         * UIProcess/API/C/WKAuthenticationChallenge.cpp: Added.
1253         (WKAuthenticationChallengeGetTypeID):
1254         * UIProcess/API/C/WKAuthenticationChallenge.h: Added.
1255         * UIProcess/API/C/WKCredential.cpp: Added.
1256         (WKCredentialGetTypeID):
1257         * UIProcess/API/C/WKCredential.h: Added.
1258         * UIProcess/API/C/WKProtectionSpace.cpp: Added.
1259         (WKProtectionSpaceGetTypeID):
1260         * UIProcess/API/C/WKProtectionSpace.h: Added.
1261
1262         Add an Authentication listener for the client app to respond to:
1263         * UIProcess/API/C/WKAuthenticationDecisionListener.cpp: Added.
1264         (WKAuthenticationDecisionListenerGetTypeID):
1265         (WKAuthenticationDecisionListenerUseCredential):
1266         (WKAuthenticationDecisionListenerCancel):
1267         * UIProcess/API/C/WKAuthenticationDecisionListener.h: Added.
1268
1269         Add Authentication related methods to the page loader client:
1270         * UIProcess/API/C/WKPage.h:
1271
1272         Add empty implementations of the new API objects:
1273         * UIProcess/Authentication: Added.
1274         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp: Added.
1275         (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
1276         (WebKit::AuthenticationChallengeProxy::~AuthenticationChallengeProxy):
1277         (WebKit::AuthenticationChallengeProxy::useCredential):
1278         (WebKit::AuthenticationChallengeProxy::cancel):
1279         * UIProcess/Authentication/AuthenticationChallengeProxy.h: Added.
1280         (WebKit::AuthenticationChallengeProxy::create):
1281         (WebKit::AuthenticationChallengeProxy::listener):
1282         (WebKit::AuthenticationChallengeProxy::type):
1283
1284         * UIProcess/Authentication/WebCredential.cpp: Added.
1285         (WebKit::WebCredential::core):
1286         * UIProcess/Authentication/WebCredential.h: Added.
1287         (WebKit::WebCredential::create):
1288         (WebKit::WebCredential::type):
1289         * UIProcess/Authentication/WebProtectionSpace.cpp: Added.
1290         (WebKit::WebProtectionSpace::WebProtectionSpace):
1291         * UIProcess/Authentication/WebProtectionSpace.h: Added.
1292         (WebKit::WebProtectionSpace::create):
1293         (WebKit::WebProtectionSpace::type):
1294
1295         Add implementation of the Authentication decision listener:
1296         * UIProcess/Authentication/AuthenticationDecisionListener.cpp: Added.
1297         (WebKit::AuthenticationDecisionListener::AuthenticationDecisionListener):
1298         (WebKit::AuthenticationDecisionListener::useCredential):
1299         (WebKit::AuthenticationDecisionListener::cancel):
1300         (WebKit::AuthenticationDecisionListener::detachChallenge):
1301         * UIProcess/Authentication/AuthenticationDecisionListener.h: Added.
1302         (WebKit::AuthenticationDecisionListener::create):
1303         (WebKit::AuthenticationDecisionListener::type):
1304
1305         WebPage and PageLoaderClient glue:
1306         * UIProcess/WebLoaderClient.cpp:
1307         (WebKit::WebLoaderClient::canAuthenticateAgainstProtectionSpaceInFrame):
1308         (WebKit::WebLoaderClient::didReceiveAuthenticationChallengeInFrame):
1309         * UIProcess/WebLoaderClient.h:
1310         * UIProcess/WebPageProxy.cpp:
1311         (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame):
1312         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge):
1313         * UIProcess/WebPageProxy.h:
1314         * UIProcess/WebPageProxy.messages.in:
1315
1316         Add a manager to map the actual platform authentication challenges to a challenge ID,
1317         as at least some platforms require the object identity to persist:
1318         * WebProcess/Authentication: Added.
1319         * WebProcess/Authentication/AuthenticationManager.cpp: Added.
1320         (WebKit::generateAuthenticationChallengeID):
1321         (WebKit::AuthenticationManager::shared):
1322         (WebKit::AuthenticationManager::AuthenticationManager):
1323         (WebKit::AuthenticationManager::didReceiveMessage):
1324         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1325         (WebKit::AuthenticationManager::useCredentialForChallenge):
1326         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
1327         (WebKit::AuthenticationManager::cancelChallenge):
1328         * WebProcess/Authentication/AuthenticationManager.h: Added.
1329         * WebProcess/Authentication/AuthenticationManager.messages.in: Added.
1330
1331         Hand off Authentication challenges to the manager to be sent over IPC:
1332         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1333         (WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
1334         (WebKit::WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace):
1335
1336         * UIProcess/API/qt/qwkpage.cpp:
1337
1338 2010-12-03  Anders Carlsson  <andersca@apple.com>
1339
1340         Reviewed by Dan Bernstein.
1341
1342         Flip the destination context when painting a backing store into the destination
1343         https://bugs.webkit.org/show_bug.cgi?id=50491
1344
1345         * Shared/cg/BackingStoreCG.cpp:
1346         (WebKit::BackingStore::paint):
1347
1348 2010-12-03  Anders Carlsson  <andersca@apple.com>
1349
1350         Reviewed by Dan Bernstein.
1351
1352         The chunked update drawing area is flipped twice when drawing
1353         https://bugs.webkit.org/show_bug.cgi?id=50465
1354         <rdar://problem/8726836>
1355
1356         * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
1357         (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
1358         (WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore):
1359         Flip the destination contexts, thus unflipping them. (Turns out two wrongs make a right here).
1360
1361 2010-12-03  Jessie Berlin  <jberlin@apple.com>
1362
1363         Reviewed by Sam Weinig.
1364
1365         Need a WebKit2 Equivalent of WebSecurityOrigin
1366         https://bugs.webkit.org/show_bug.cgi?id=50170
1367
1368         * Shared/API/c/WKBase.h:
1369         Add the WKSecurityOriginRef typedef.
1370
1371         * Shared/APIObject.h:
1372         Add the SecurityOrigin type as a Shared type.
1373
1374         * Shared/API/c/WKSharedAPICast.h::
1375         Add the mapping between WKSecurityOriginRef and WebSecurityOrigin.
1376
1377         * UIProcess/API/C/WKSecurityOrigin.cpp: Added.
1378         (WKSecurityOriginGetTypeID):
1379         (WKSecurityOriginCreate):
1380         (WKSecurityOriginGetProtocol):
1381         (WKSecurityOriginGetHost):
1382         (WKSecurityOriginGetPort):
1383         * UIProcess/API/C/WKSecurityOrigin.h: Added.
1384
1385         * UIProcess/WebSecurityOrigin.h: Added.
1386         (WebKit::WebSecurityOrigin::create):
1387         Create based on the database identifier, which contains the protocol, host and port.
1388         (WebKit::WebSecurityOrigin::protocol):
1389         (WebKit::WebSecurityOrigin::host):
1390         (WebKit::WebSecurityOrigin::port):
1391         (WebKit::WebSecurityOrigin::databaseIdentifier):
1392         (WebKit::WebSecurityOrigin::WebSecurityOrigin):
1393         (WebKit::WebSecurityOrigin::type):
1394
1395         * WebKit2.pro:
1396         Add WKSecurityOrigin.cpp/.h.
1397
1398         * WebKit2.xcodeproj/project.pbxproj:
1399         * win/WebKit2.vcproj:
1400         Add the WebSecurityOrigin.h and WKSecurityOrigin.cpp/.h.
1401
1402         * win/WebKit2Generated.make:
1403         Make sure WKSecurityOrigin.h file gets copied over to the WebKitBuild directory on Windows.
1404
1405 2010-12-02  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1406
1407         Reviewed by Csaba Osztrogonác.
1408
1409         [Qt] Fix compilation with !ENABLE(OFFLINE_WEB_APPLICATIONS) and 
1410         !ENABLE(TILED_BACKING_STORE) for WebKit2
1411         https://bugs.webkit.org/show_bug.cgi?id=50071
1412
1413         Add appropriate guards. No functional change if guards are set.
1414
1415         * UIProcess/API/qt/qwkpage.cpp:
1416         (QWKPage::setActualVisibleContentsRect):
1417         * UIProcess/TiledDrawingAreaProxy.cpp:
1418         * UIProcess/qt/TiledDrawingAreaProxyQt.cpp:
1419         * UIProcess/qt/TiledDrawingAreaTileQt.cpp:
1420         * UIProcess/qt/WebContextQt.cpp:
1421         (WebKit::WebContext::applicationCacheDirectory):
1422         * WebProcess/WebProcess.cpp:
1423         (WebKit::WebProcess::initializeWebProcess):
1424
1425 2010-12-02  Sam Weinig  <sam@webkit.org>
1426
1427         Fix Qt.
1428
1429         * UIProcess/API/qt/qwkpreferences.cpp:
1430         (QWKPreferencesPrivate::createPreferences):
1431
1432 2010-12-02  Sam Weinig  <sam@webkit.org>
1433
1434         Reviewed by Anders Carlsson.
1435
1436         WebKit2 Preferences should be held off the PageGroup, not the Context
1437         https://bugs.webkit.org/show_bug.cgi?id=50414
1438
1439         - In addition, this now makes the preference held off the PageGroup have
1440           the identifier of the PageGroup and autosave to disk (only on the mac
1441           for now).
1442         - Adds ability to create an arbitrary preference that can be autosaved
1443           via a new WKPreferencesCreateWithIdentifier function.
1444
1445         * UIProcess/API/C/WKContext.cpp:
1446         * UIProcess/API/C/WKContext.h:
1447         Remove preference related code.
1448
1449         * UIProcess/API/C/WKPageGroup.cpp:
1450         (WKPageGroupSetPreferences):
1451         (WKPageGroupGetPreferences):
1452         * UIProcess/API/C/WKPageGroup.h:
1453         Add getter/setter for preferences.
1454
1455         * UIProcess/API/C/WKPreferences.cpp:
1456         (WKPreferencesCreateWithIdentifier):
1457         * UIProcess/API/C/WKPreferences.h:
1458         Add WKPreferencesCreateWithIdentifier and remove WKPreferencesCreateCopy which is
1459         unused.
1460
1461         * UIProcess/WebContext.cpp:
1462         (WebKit::WebContext::WebContext):
1463         (WebKit::WebContext::~WebContext):
1464         * UIProcess/WebContext.h:
1465         Remove preference related code.
1466
1467         * UIProcess/WebPageGroup.cpp:
1468         (WebKit::WebPageGroup::WebPageGroup):
1469         (WebKit::WebPageGroup::addPage):
1470         (WebKit::WebPageGroup::removePage):
1471         (WebKit::WebPageGroup::setPreferences):
1472         (WebKit::WebPageGroup::preferences):
1473         (WebKit::WebPageGroup::preferencesDidChange):
1474         * UIProcess/WebPageGroup.h:
1475         Add preference and page tracking.
1476
1477         * UIProcess/WebPageNamespace.cpp:
1478         * UIProcess/WebPageNamespace.h:
1479         Remove preference change notification code.
1480
1481         * UIProcess/WebPageProxy.cpp:
1482         (WebKit::WebPageProxy::WebPageProxy):
1483         (WebKit::WebPageProxy::~WebPageProxy):
1484         Add/remove self from page group set.
1485
1486         (WebKit::WebPageProxy::preferencesDidChange):
1487         (WebKit::WebPageProxy::creationParameters):
1488         Get preferences from the pageGroup.
1489
1490         * UIProcess/WebPreferences.cpp:
1491         (WebKit::WebPreferences::WebPreferences):
1492         (WebKit::WebPreferences::addPageGroup):
1493         (WebKit::WebPreferences::removePageGroup):
1494         (WebKit::WebPreferences::update):
1495         * UIProcess/WebPreferences.h:
1496         (WebKit::WebPreferences::create):
1497         Change to track page groups instead of contexts.
1498
1499         * UIProcess/mac/WebPreferencesMac.mm:
1500         (WebKit::makeKey): Add ".WebKit2" prefix for keys.
1501
1502 2010-12-02  Anders Carlsson  <andersca@apple.com>
1503
1504         Reviewed by Sam Weinig.
1505
1506         Flash videos on YouTube flicker
1507         https://bugs.webkit.org/show_bug.cgi?id=50409
1508         <rdar://problem/8668757>
1509
1510         When painting from a backing store, we need to add the source location
1511         to the destination point.
1512
1513         * WebProcess/Plugins/PluginProxy.cpp:
1514         (WebKit::PluginProxy::paint):
1515         (WebKit::PluginProxy::update):
1516
1517 2010-12-02  Sam Weinig  <sam@webkit.org>
1518
1519         Reviewed by Anders Carlsson.
1520
1521         WebKit2 needs API to turn on popup blocking
1522         https://bugs.webkit.org/show_bug.cgi?id=50407
1523
1524         Pipe-through a preference for javascript being able to open
1525         windows without user gesture.
1526
1527         * Shared/WebPreferencesStore.h:
1528         * UIProcess/API/C/WKPreferences.cpp:
1529         (WKPreferencesSetJavaScriptCanOpenWindowsAutomatically):
1530         (WKPreferencesGetJavaScriptCanOpenWindowsAutomatically):
1531         * UIProcess/API/C/WKPreferences.h:
1532         * WebProcess/WebPage/WebPage.cpp:
1533         (WebKit::WebPage::updatePreferences):
1534
1535 2010-12-02  Anders Carlsson  <andersca@apple.com>
1536
1537         Reviewed by Sam Weinig.
1538
1539         Plug-ins should be able to update the mouse cursor
1540         https://bugs.webkit.org/show_bug.cgi?id=50399
1541
1542         Call WKEnableSettingCursorWhenInBackground.
1543
1544         * PluginProcess/mac/PluginProcessMainMac.mm:
1545         (WebKit::PluginProcessMain):
1546
1547 2010-12-02  Sam Weinig  <sam@webkit.org>
1548
1549         Reviewed by Anders Carlsson.
1550
1551         https://bugs.webkit.org/show_bug.cgi?id=50368
1552         Overhaul WebKit2 preferences code
1553
1554         - Reduces the number of places you have to touch to add a new preference
1555           (From 9 down to 4, but with a bit of elbow grease, we should get that
1556            down to 2 or 3).
1557         - Add hooks so that platforms can initialize the preferences based on an
1558           identifier. This is currently only used on the Mac to initialize a
1559           preference store from NSUserDefaults and autosave the changes to disk.
1560           It is not yet enabled due to no way to set the identifier from client
1561           code.
1562
1563         * Shared/WebPageCreationParameters.cpp:
1564         Add necessary #include of WebCoreArgumentCoders.h which is now needed
1565         due to cleanup in WebPreferencesStore.h.
1566
1567         * Shared/WebPreferencesStore.cpp:
1568         (WebKit::WebPreferencesStore::WebPreferencesStore):
1569         (WebKit::WebPreferencesStore::encode):
1570         (WebKit::WebPreferencesStore::decode):
1571         (WebKit::defaultValueForKey):
1572         (WebKit::setValueForKey):
1573         (WebKit::valueForKey):
1574         (WebKit::WebPreferencesStore::setStringValueForKey):
1575         (WebKit::WebPreferencesStore::getStringValueForKey):
1576         (WebKit::WebPreferencesStore::setBoolValueForKey):
1577         (WebKit::WebPreferencesStore::getBoolValueForKey):
1578         (WebKit::WebPreferencesStore::setUInt32ValueForKey):
1579         (WebKit::WebPreferencesStore::getUInt32ValueForKey):
1580         * Shared/WebPreferencesStore.h:
1581         Complete overhaul of this class to store the preferences as
1582         a set of HashMaps and use macros to define the keys and default
1583         values.
1584
1585         * UIProcess/API/C/WKPreferences.cpp:
1586         (WKPreferencesGetFontSmoothingLevel):
1587         Add cast to keep conversion function working.
1588
1589         * UIProcess/WebPreferences.cpp:
1590         (WebKit::WebPreferences::WebPreferences): Add identifier constructor.
1591         (WebKit::WebPreferences::updateStringValueForKey):
1592         (WebKit::WebPreferences::updateBoolValueForKey):
1593         (WebKit::WebPreferences::updateUInt32ValueForKey):
1594         Add type based updaters. These currently give hooks to the platform and
1595         call the generic update, but in the future, we can use this to optimize
1596         updating preferences to not send the entire store for each change.
1597
1598         * UIProcess/WebPreferences.h:
1599         Generate the getters and setters via macro instantiation.
1600
1601         * UIProcess/cf/WebPreferencesCF.cpp: Added.
1602         (WebKit::WebPreferences::platformInitializeStore):
1603         (WebKit::WebPreferences::platformUpdateStringValueForKey):
1604         (WebKit::WebPreferences::platformUpdateBoolValueForKey):
1605         (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
1606         Stubbed out.
1607
1608         * UIProcess/mac/WebPreferencesMac.mm: Added.
1609         (WebKit::makeKey):
1610         (WebKit::setStringValueIfInUserDefaults):
1611         (WebKit::setBoolValueIfInUserDefaults):
1612         (WebKit::setUInt32ValueIfInUserDefaults):
1613         (WebKit::WebPreferences::platformInitializeStore):
1614         (WebKit::WebPreferences::platformUpdateStringValueForKey):
1615         (WebKit::WebPreferences::platformUpdateBoolValueForKey):
1616         (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
1617         Use the platform hooks to initialize and update the store from
1618         NSUserDefaults.
1619         
1620         * UIProcess/qt/WebPreferencesQt.cpp: Added.
1621         (WebKit::WebPreferences::platformInitializeStore):
1622         (WebKit::WebPreferences::platformUpdateStringValueForKey):
1623         (WebKit::WebPreferences::platformUpdateBoolValueForKey):
1624         (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
1625         Stubbed out.
1626
1627         * WebProcess/WebPage/WebPage.cpp:
1628         (WebKit::WebPage::updatePreferences):
1629         * WebProcess/WebPage/win/WebPageWin.cpp:
1630         (WebKit::WebPage::platformPreferencesDidChange):
1631         Update to pull the value using the new type based getters.
1632
1633         * WebKit2.pro:
1634         * WebKit2.xcodeproj/project.pbxproj:
1635         * win/WebKit2.vcproj:
1636         Add new files.
1637
1638 2010-12-02  Steve Falkenburg  <sfalken@apple.com>
1639
1640         Mac build fix.
1641
1642         * WebProcess/WebKitMain.cpp:
1643         (enableDataExecutionPrevention):
1644
1645 2010-11-30 Amruth Raj  <amruthraj@motorola.com> and Ravi Kasibhatla  <ravi.kasibhatla@motorola.com>
1646
1647         Reviewed by Martin Robinson.
1648
1649         [GTK] Implement RunLoop, WorkQueue, Connection classes for WebKit2
1650         https://bugs.webkit.org/show_bug.cgi?id=48507
1651
1652         * Platform/CoreIPC/Connection.h: UNIX_X11 specific changes for GTK port.
1653         (CoreIPC::Connection::messageProcessingCompleted):
1654         * Platform/CoreIPC/gtk: Added.
1655         * Platform/CoreIPC/gtk/ConnectionGtk.cpp: Added. Connection class implementation for GTK port (UNIX_X11 specific).
1656         (CoreIPC::readBytesFromSocket):
1657         (CoreIPC::writeBytesToSocket):
1658         (CoreIPC::Connection::platformInitialize):
1659         (CoreIPC::Connection::platformInvalidate):
1660         (CoreIPC::Connection::processCompletedMessage):
1661         (CoreIPC::Connection::readEventHandler):
1662         (CoreIPC::Connection::open):
1663         (CoreIPC::Connection::platformCanSendOutgoingMessages):
1664         (CoreIPC::Connection::sendOutgoingMessage):
1665         * Platform/PlatformProcessIdentifier.h: UNIX_X11 specific changes for GTK port.
1666         * Platform/RunLoop.h: GTK port specific changes.
1667         * Platform/WorkQueue.h: GTK port specific changes.
1668         * Platform/gtk/RunLoopGtk.cpp: Added. Runs an event loop using GMainLoop and handles the incoming messages.
1669         (RunLoop::RunLoop):
1670         (RunLoop::~RunLoop):
1671         (RunLoop::run):
1672         (RunLoop::mainLoop):
1673         (RunLoop::stop):
1674         (RunLoop::queueWork):
1675         (RunLoop::wakeUp):
1676         (RunLoop::TimerBase::TimerBase):
1677         (RunLoop::TimerBase::~TimerBase):
1678         (RunLoop::TimerBase::resetTimerSource):
1679         (RunLoop::TimerBase::oneShotTimerFired):
1680         (RunLoop::TimerBase::repeatingTimerFired):
1681         (RunLoop::TimerBase::start):
1682         (RunLoop::TimerBase::stop):
1683         (RunLoop::TimerBase::isActive):
1684         * Platform/gtk/WorkQueueGtk.cpp: Added. Creates a thread and polls on a given fd using GIOChannel. 
1685         Dispatches the obtained messages to RunLoop's GMainLoop.
1686         (WorkQueue::EventSource::EventSource):
1687         (WorkQueue::EventSource::dispatchSource):
1688         (WorkQueue::EventSource::performWorkOnce):
1689         (WorkQueue::EventSource::performWork):
1690         (WorkQueue::EventSource::deleteEventSource):
1691         (WorkQueue::platformInitialize):
1692         (WorkQueue::platformInvalidate):
1693         (WorkQueue::startWorkQueueThread):
1694         (WorkQueue::workQueueThreadBody):
1695         (WorkQueue::registerEventSourceHandler):
1696         (WorkQueue::unregisterEventSourceHandler):
1697         (WorkQueue::scheduleWork):
1698
1699 2010-12-02  Steve Falkenburg  <sfalken@apple.com>
1700
1701         Reviewed by Adam Roben.
1702
1703         Move enableExecutionPrevention to WebKitMain
1704         https://bugs.webkit.org/show_bug.cgi?id=50392
1705
1706         * WebProcess/WebKitMain.cpp:
1707         (enableDataExecutionPrevention):
1708         (WebKitMain):
1709         * WebProcess/win/WebProcessMainWin.cpp:
1710         (WebKit::WebProcessMain):
1711
1712 2010-12-02  Steve Falkenburg  <sfalken@apple.com>
1713
1714         Reviewed by Adam Roben.
1715
1716         Enable DEP at runtime to allow for compatibility with older versions of ATL
1717         https://bugs.webkit.org/show_bug.cgi?id=50378
1718
1719         * WebProcess/win/WebProcessMainWin.cpp:
1720         (WebKit::enableDataExecutionPrevention):
1721         (WebKit::WebProcessMain):
1722         * win/WebKit2WebProcessCommon.vsprops:
1723
1724 2010-12-01  Sam Weinig  <sam@webkit.org>
1725
1726         Fix 64-bit build.
1727
1728         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1729         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
1730
1731 2010-12-01  Anders Carlsson  <andersca@apple.com>
1732
1733         Reviewed by Sam Weinig.
1734
1735         Give the fake Carbon window the right bounds
1736         https://bugs.webkit.org/show_bug.cgi?id=50361
1737
1738         * PluginProcess/PluginControllerProxy.cpp:
1739         (WebKit::PluginControllerProxy::windowAndViewFramesChanged):
1740         * PluginProcess/PluginControllerProxy.h:
1741         * PluginProcess/PluginControllerProxy.messages.in:
1742         * UIProcess/API/mac/WKView.mm:
1743         (-[WKView _updateWindowAndViewFrames]):
1744         Pass both the window frame and view frame along.
1745
1746         (-[WKView renewGState]):
1747         Call _updateWindowAndViewFrames.
1748
1749         * UIProcess/WebPageProxy.cpp:
1750         (WebKit::WebPageProxy::windowAndViewFramesChanged):
1751         Pass both the window frame and view frame along.
1752
1753         * UIProcess/WebPageProxy.h:
1754         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1755         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1756         (WebKit::NetscapePlugin::platformPostInitialize):
1757         We don't want a title bar in our fake window.
1758     
1759         (WebKit::computeFakeWindowBoundsRect):
1760         Compute the fake window bounds.
1761
1762         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
1763         Update the fake window bounds.
1764
1765         * WebProcess/Plugins/Plugin.h:
1766         * WebProcess/Plugins/PluginProxy.cpp:
1767         (WebKit::PluginProxy::windowAndViewFramesChanged):
1768         * WebProcess/Plugins/PluginProxy.h:
1769         * WebProcess/Plugins/PluginView.cpp:
1770         (WebKit::PluginView::windowAndViewFramesChanged):
1771         (WebKit::PluginView::initializePlugin):
1772         * WebProcess/Plugins/PluginView.h:
1773         * WebProcess/WebPage/WebPage.cpp:
1774         (WebKit::WebPage::windowAndViewFramesChanged):
1775         * WebProcess/WebPage/WebPage.h:
1776         (WebKit::WebPage::windowFrameInScreenCoordinates):
1777         (WebKit::WebPage::viewFrameInWindowCoordinates):
1778         * WebProcess/WebPage/WebPage.messages.in:
1779         Pass both the window frame and view frame along.
1780
1781 2010-12-01  Jia Pu  <jpu@apple.com>
1782
1783         Reviewed by Darin Adler.
1784
1785         Support multiple correction candidates panel for misspelled word on Mac OS X.
1786         https://bugs.webkit.org/show_bug.cgi?id=50137
1787         <rdar://problem/8568059>
1788
1789         Adopted new function signatures defined in base class.
1790
1791         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1792         (WebKit::WebEditorClient::getGuessesForWord):
1793         * WebProcess/WebCoreSupport/WebEditorClient.h:
1794         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1795         (WebKit::WebEditorClient::showCorrectionPanel):
1796
1797 2010-12-01  Simon Fraser  <simon.fraser@apple.com>
1798
1799         Reviewed by John Sullivan.
1800
1801         Hit testing broken on sibling views of the WKView
1802         <rdar://problem/8718397>
1803         
1804         Make sure that hitView is not null when comparing with the
1805         _layerHostingView.
1806
1807         * UIProcess/API/mac/WKView.mm:
1808         (-[WKView hitTest:]):
1809
1810 2010-12-01  Anders Carlsson  <andersca@apple.com>
1811
1812         Reviewed by Sam Weinig.
1813
1814         Implement the remaining PluginController/Plugin member functions
1815         https://bugs.webkit.org/show_bug.cgi?id=50356
1816
1817         * PluginProcess/PluginControllerProxy.cpp:
1818         (WebKit::PluginControllerProxy::cancelStreamLoad):
1819         (WebKit::PluginControllerProxy::cancelManualStreamLoad):
1820         (WebKit::PluginControllerProxy::setStatusbarText):
1821         (WebKit::PluginControllerProxy::pluginProcessCrashed):
1822         (WebKit::PluginControllerProxy::frameDidFinishLoading):
1823         (WebKit::PluginControllerProxy::frameDidFail):
1824         (WebKit::PluginControllerProxy::manualStreamDidReceiveResponse):
1825         (WebKit::PluginControllerProxy::manualStreamDidReceiveData):
1826         (WebKit::PluginControllerProxy::manualStreamDidFinishLoading):
1827         (WebKit::PluginControllerProxy::manualStreamDidFail):
1828         * PluginProcess/PluginControllerProxy.h:
1829         * PluginProcess/PluginControllerProxy.messages.in:
1830         * WebProcess/Plugins/PluginProxy.cpp:
1831         (WebKit::PluginProxy::frameDidFinishLoading):
1832         (WebKit::PluginProxy::frameDidFail):
1833         (WebKit::PluginProxy::manualStreamDidReceiveResponse):
1834         (WebKit::PluginProxy::manualStreamDidReceiveData):
1835         (WebKit::PluginProxy::manualStreamDidFinishLoading):
1836         (WebKit::PluginProxy::manualStreamDidFail):
1837         (WebKit::PluginProxy::windowFrameChanged):
1838         (WebKit::PluginProxy::cancelStreamLoad):
1839         (WebKit::PluginProxy::cancelManualStreamLoad):
1840         (WebKit::PluginProxy::setStatusbarText):
1841         * WebProcess/Plugins/PluginProxy.h:
1842         * WebProcess/Plugins/PluginProxy.messages.in:
1843
1844 2010-12-01  Steve Falkenburg  <sfalken@apple.com>
1845
1846         Reviewed by Adam Roben.
1847
1848         WinCairo build should not use link-time code generation (LTCG)
1849         https://bugs.webkit.org/show_bug.cgi?id=50353
1850
1851         * win/WebKit2.vcproj:
1852         * win/WebKit2WebProcess.vcproj:
1853
1854 2010-12-01  Anders Carlsson  <andersca@apple.com>
1855
1856         Reviewed by Sam Weinig..
1857
1858         Fix <rdar://problem/8717674>.
1859
1860         * WebProcess/com.apple.WebProcess.sb:
1861         Allow the UI process to issue file-write extensions.
1862
1863 2010-12-01  Sam Weinig  <sam@webkit.org>
1864
1865         Another windows build fix.
1866
1867         * UIProcess/API/C/win/WKView.cpp:
1868         (WKViewCreate):
1869
1870 2010-12-01  Sam Weinig  <sam@webkit.org>
1871
1872         Attempt to fix Windows build.
1873
1874         * UIProcess/API/C/win/WKViewPrivate.cpp:
1875         * UIProcess/API/C/win/WKViewPrivate.h:
1876
1877 2010-12-01  Sam Weinig  <sam@webkit.org>
1878
1879         Reviewed by Anders Carlsson.
1880
1881         Add PageGrouping to WebKit2 API
1882         https://bugs.webkit.org/show_bug.cgi?id=50332
1883
1884         - Adds WKPageGroupRef and WKBundlePageGroupRef API objects
1885           (backed by WebPageGroup and WebPageGroupProxy respectively).
1886         - Moves visibleToInjectedBundle from page to PageGroup.
1887         - Make userScript/userStyleSheet functions take a page group parameter.
1888
1889         * Shared/API/c/WKBase.h:
1890         * Shared/APIObject.h:
1891         * Shared/WebPageCreationParameters.cpp:
1892         (WebKit::WebPageCreationParameters::encode):
1893         (WebKit::WebPageCreationParameters::decode):
1894         * Shared/WebPageCreationParameters.h:
1895         * Shared/WebPageGroupData.cpp: Added.
1896         (WebKit::WebPageGroupData::encode):
1897         (WebKit::WebPageGroupData::decode):
1898         * Shared/WebPageGroupData.h: Added.
1899         * UIProcess/API/C/WKAPICast.h:
1900         * UIProcess/API/C/WKPage.cpp:
1901         (WKPageGetPageGroup):
1902         * UIProcess/API/C/WKPage.h:
1903         * UIProcess/API/C/WKPageGroup.cpp: Added.
1904         (WKPageGroupGetTypeID):
1905         (WKPageGroupCreateWithIdentifier):
1906         (WKPageGroupCopyIdentifier):
1907         * UIProcess/API/C/WKPageGroup.h: Added.
1908         * UIProcess/API/C/WebKit2.h:
1909         * UIProcess/API/C/win/WKView.cpp:
1910         (WKViewCreate):
1911         * UIProcess/API/C/win/WKView.h:
1912         * UIProcess/API/mac/WKView.h:
1913         * UIProcess/API/mac/WKView.mm:
1914         (-[WKView initWithFrame:pageNamespaceRef:pageGroupRef:]):
1915         (-[WKView initWithFrame:pageNamespaceRef:]):
1916         * UIProcess/API/mac/WKViewInternal.h:
1917         * UIProcess/API/qt/qwkpage.cpp:
1918         (QWKPagePrivate::QWKPagePrivate):
1919         * UIProcess/WebContext.cpp:
1920         (WebKit::WebContext::WebContext):
1921         (WebKit::WebContext::createWebPage):
1922         * UIProcess/WebContext.h:
1923         * UIProcess/WebContextUserMessageCoders.h:
1924         (WebKit::WebContextUserMessageEncoder::encode):
1925         (WebKit::WebContextUserMessageDecoder::decode):
1926         * UIProcess/WebInspectorProxy.cpp:
1927         (WebKit::WebInspectorProxy::inspectorPageGroup):
1928         * UIProcess/WebInspectorProxy.h:
1929         * UIProcess/WebPageGroup.cpp: Added.
1930         (WebKit::generatePageGroupID):
1931         (WebKit::webPageGroupMap):
1932         (WebKit::WebPageGroup::create):
1933         (WebKit::WebPageGroup::get):
1934         (WebKit::WebPageGroup::WebPageGroup):
1935         (WebKit::WebPageGroup::~WebPageGroup):
1936         * UIProcess/WebPageGroup.h: Added.
1937         (WebKit::WebPageGroup::identifier):
1938         (WebKit::WebPageGroup::pageGroupID):
1939         (WebKit::WebPageGroup::data):
1940         (WebKit::WebPageGroup::type):
1941         * UIProcess/WebPageNamespace.cpp:
1942         (WebKit::WebPageNamespace::createWebPage):
1943         * UIProcess/WebPageNamespace.h:
1944         * UIProcess/WebPageProxy.cpp:
1945         (WebKit::WebPageProxy::create):
1946         (WebKit::WebPageProxy::WebPageProxy):
1947         (WebKit::WebPageProxy::creationParameters):
1948         * UIProcess/WebPageProxy.h:
1949         (WebKit::WebPageProxy::pageGroup):
1950         * UIProcess/WebProcessProxy.cpp:
1951         (WebKit::WebProcessProxy::createWebPage):
1952         * UIProcess/WebProcessProxy.h:
1953         * UIProcess/mac/WebInspectorProxyMac.mm:
1954         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1955         * UIProcess/win/WebView.cpp:
1956         (WebKit::WebView::WebView):
1957         * UIProcess/win/WebView.h:
1958         (WebKit::WebView::create):
1959         * WebKit2.pro:
1960         * WebKit2.xcodeproj/project.pbxproj:
1961         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1962         (WKBundleAddUserScript):
1963         (WKBundleAddUserStyleSheet):
1964         (WKBundleRemoveUserScript):
1965         (WKBundleRemoveUserStyleSheet):
1966         (WKBundleRemoveUserScripts):
1967         (WKBundleRemoveUserStyleSheets):
1968         (WKBundleRemoveAllUserContent):
1969         (WKBundleOverrideXSSAuditorEnabledForTestRunner):
1970         * WebProcess/InjectedBundle/API/c/WKBundle.h:
1971         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
1972         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1973         (WKBundlePageGetPageGroup):
1974         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1975         * WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp: Added.
1976         (WKBundlePageGroupGetTypeID):
1977         (WKBundlePageGroupCopyIdentifier):
1978         * WebProcess/InjectedBundle/API/c/WKBundlePageGroup.h: Added.
1979         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1980         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1981         (WebKit::InjectedBundle::overrideXSSAuditorEnabledForTestRunner):
1982         (WebKit::InjectedBundle::addUserScript):
1983         (WebKit::InjectedBundle::addUserStyleSheet):
1984         (WebKit::InjectedBundle::removeUserScript):
1985         (WebKit::InjectedBundle::removeUserStyleSheet):
1986         (WebKit::InjectedBundle::removeUserScripts):
1987         (WebKit::InjectedBundle::removeUserStyleSheets):
1988         (WebKit::InjectedBundle::removeAllUserContent):
1989         (WebKit::InjectedBundle::didInitializePageGroup):
1990         * WebProcess/InjectedBundle/InjectedBundle.h:
1991         * WebProcess/InjectedBundle/InjectedBundleClient.cpp:
1992         (WebKit::InjectedBundleClient::didInitializePageGroup):
1993         * WebProcess/InjectedBundle/InjectedBundleClient.h:
1994         * WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h:
1995         (WebKit::InjectedBundleUserMessageEncoder::encode):
1996         (WebKit::InjectedBundleUserMessageDecoder::decode):
1997         * WebProcess/WebPage/WebPage.cpp:
1998         (WebKit::WebPage::create):
1999         (WebKit::WebPage::WebPage):
2000         (WebKit::WebPage::close):
2001         * WebProcess/WebPage/WebPage.h:
2002         (WebKit::WebPage::pageGroup):
2003         * WebProcess/WebPage/WebPageGroupProxy.cpp: Added.
2004         (WebKit::WebPageGroupProxy::create):
2005         (WebKit::WebPageGroupProxy::~WebPageGroupProxy):
2006         * WebProcess/WebPage/WebPageGroupProxy.h: Added.
2007         (WebKit::WebPageGroupProxy::identifier):
2008         (WebKit::WebPageGroupProxy::pageGroupID):
2009         (WebKit::WebPageGroupProxy::isVisibleToInjectedBundle):
2010         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
2011         (WebKit::WebPageGroupProxy::type):
2012         * WebProcess/WebProcess.cpp:
2013         (WebKit::WebProcess::webPageGroup):
2014         * WebProcess/WebProcess.h:
2015         * win/WebKit2.vcproj:
2016         * win/WebKit2Generated.make:
2017
2018 2010-12-01  Steve Falkenburg  <sfalken@apple.com>
2019
2020         Reviewed by Adam Roben.
2021
2022         vcproj changes can't be applied cleanly by the Windows EWS bot
2023         https://bugs.webkit.org/show_bug.cgi?id=50328
2024
2025         * win/WebKit2.submit.sln: Added property svn:eol-style.
2026         * win/WebKit2.vcproj: Added property svn:eol-style.
2027         * win/WebKit2Apple.vsprops: Added property svn:eol-style.
2028         * win/WebKit2CFLite.vsprops: Added property svn:eol-style.
2029         * win/WebKit2Common.vsprops: Added property svn:eol-style.
2030         * win/WebKit2DirectX.vsprops: Added property svn:eol-style.
2031         * win/WebKit2Generated.vcproj: Added property svn:eol-style.
2032         * win/WebKit2GeneratedCommon.vsprops: Added property svn:eol-style.
2033         * win/WebKit2WebProcess.vcproj: Added property svn:eol-style.
2034         * win/WebKit2WebProcessCommon.vsprops: Added property svn:eol-style.
2035
2036 2010-12-01  Simon Fraser  <simon.fraser@apple.com>
2037
2038         Reviewed by Anders Carlsson.
2039
2040         Size changes on layer-backed drawing areas don't always end up with the correct value
2041         https://bugs.webkit.org/show_bug.cgi?id=50351
2042         <rdar://problem/8692966>
2043         
2044         When the UI process does not receive didSetSize messages promptly, 
2045         LayerBackedDrawingAreaProxy::setSize() bails early based on the
2046         m_isWaitingForDidSetFrameNotification flag.
2047         
2048         In this situation, the final size may be incorrect. didSetSize()
2049         needs to compare the size that the web process has to the expected size,
2050         and send a final setSize if they differ.
2051
2052         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
2053         (WebKit::LayerBackedDrawingAreaProxy::didSetSize):
2054         (WebKit::LayerBackedDrawingAreaProxy::didReceiveMessage):
2055         * UIProcess/LayerBackedDrawingAreaProxy.h:
2056         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
2057         (WebKit::LayerBackedDrawingArea::setSize):
2058
2059 2010-12-01  Simon Fraser  <simon.fraser@apple.com>
2060
2061         Reviewed by Anders Carlsson.
2062
2063         Crash when closing WebKit2 window with accelerated composting content
2064         https://bugs.webkit.org/show_bug.cgi?id=50307
2065         <rdar://problem/8640126>
2066         
2067         When the web page is closing, notify the drawing area, so that
2068         the layer-backed drawing area can kill the runloop obsever,
2069         then clear it. Clearing it is not sufficient, since the drawing
2070         area is ref-counted.
2071
2072         * WebProcess/WebPage/DrawingArea.h:
2073         (WebKit::DrawingArea::onPageClose):
2074         * WebProcess/WebPage/LayerBackedDrawingArea.h:
2075         * WebProcess/WebPage/WebPage.cpp:
2076         (WebKit::WebPage::close):
2077         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
2078         (WebKit::LayerBackedDrawingArea::platformClear):
2079         (WebKit::LayerBackedDrawingArea::onPageClose):
2080
2081 2010-12-01  Anders Carlsson  <andersca@apple.com>
2082
2083         Reviewed by Darin Adler.
2084
2085         Return a correct user agent if NPN_UserAgent is called with a null NPP from NPP_New.
2086         https://bugs.webkit.org/show_bug.cgi?id=50336
2087
2088         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2089         (WebKit::NPN_UserAgent):
2090         Call the static NetscapePlugin::userAgent function instead.
2091
2092         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2093         (WebKit::NetscapePlugin::userAgent):
2094         If the passed in NPP is null, get the NetscapePlugin currently executing NPP_New.
2095
2096         (WebKit::NetscapePlugin::initialize):
2097         Keep track of the plug-in currently executing NPP_New.
2098
2099         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2100
2101 2010-12-01  Brian Weinstein  <bweinstein@apple.com>
2102
2103         One last Windows build fix.
2104
2105         * UIProcess/win/WebView.cpp:
2106         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary):
2107
2108 2010-12-01  Anders Carlsson  <andersca@apple.com>
2109
2110         Fix Windows build.
2111
2112         * UIProcess/win/WebView.cpp:
2113         (WebKit::WebView::pageDidEnterAcceleratedCompositing):
2114         (WebKit::WebView::pageDidLeaveAcceleratedCompositing):
2115         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary):
2116
2117 2010-12-01  Anders Carlsson  <andersca@apple.com>
2118
2119         Fix build.
2120
2121         * UIProcess/win/WebView.h:
2122
2123 2010-12-01  Anders Carlsson  <andersca@apple.com>
2124
2125         Reviewed by Andreas Kling.
2126
2127         Get rid of DrawingAreaBase
2128         https://bugs.webkit.org/show_bug.cgi?id=50329
2129
2130         * Scripts/webkit2/messages.py:
2131         * Shared/DrawingAreaInfo.h:
2132         (WebKit::DrawingAreaInfo::DrawingAreaInfo):
2133         * Shared/WebPageCreationParameters.h:
2134         * UIProcess/API/mac/WKView.mm:
2135         (-[WKView _switchToDrawingAreaTypeIfNecessary:DrawingAreaInfo::]):
2136         (-[WKView _pageDidEnterAcceleratedCompositing]):
2137         (-[WKView _pageDidLeaveAcceleratedCompositing]):
2138         * UIProcess/API/qt/qgraphicswkview.cpp:
2139         (QGraphicsWKView::takeSnapshot):
2140         (QGraphicsWKViewPrivate::commitScale):
2141         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
2142         (WebKit::ChunkedUpdateDrawingAreaProxy::ChunkedUpdateDrawingAreaProxy):
2143         (WebKit::ChunkedUpdateDrawingAreaProxy::setSize):
2144         (WebKit::ChunkedUpdateDrawingAreaProxy::setPageIsVisible):
2145         (WebKit::ChunkedUpdateDrawingAreaProxy::update):
2146         * UIProcess/DrawingAreaProxy.cpp:
2147         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2148         (WebKit::DrawingAreaProxy::nextIdentifier):
2149         * UIProcess/DrawingAreaProxy.h:
2150         (WebKit::DrawingAreaProxy::info):
2151         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
2152         (WebKit::LayerBackedDrawingAreaProxy::LayerBackedDrawingAreaProxy):
2153         (WebKit::LayerBackedDrawingAreaProxy::setSize):
2154         (WebKit::LayerBackedDrawingAreaProxy::setPageIsVisible):
2155         (WebKit::LayerBackedDrawingAreaProxy::update):
2156         * UIProcess/TiledDrawingAreaProxy.cpp:
2157         (WebKit::TiledDrawingAreaProxy::TiledDrawingAreaProxy):
2158         * UIProcess/WebPageProxy.cpp:
2159         (WebKit::WebPageProxy::didChangeAcceleratedCompositing):
2160         * UIProcess/WebPageProxy.h:
2161         * UIProcess/WebPageProxy.messages.in:
2162         * UIProcess/win/WebView.cpp:
2163         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary):
2164         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
2165         (WebKit::ChunkedUpdateDrawingArea::ChunkedUpdateDrawingArea):
2166         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
2167         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
2168         * WebProcess/WebPage/DrawingArea.cpp:
2169         (WebKit::DrawingArea::create):
2170         (WebKit::DrawingArea::DrawingArea):
2171         * WebProcess/WebPage/DrawingArea.h:
2172         (WebKit::DrawingArea::info):
2173         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
2174         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
2175         (WebKit::LayerBackedDrawingArea::didReceiveMessage):
2176         * WebProcess/WebPage/LayerBackedDrawingArea.h:
2177         * WebProcess/WebPage/TiledDrawingArea.cpp:
2178         (WebKit::TiledDrawingArea::TiledDrawingArea):
2179         * WebProcess/WebPage/TiledDrawingArea.h:
2180         * WebProcess/WebPage/WebPage.cpp:
2181         (WebKit::WebPage::WebPage):
2182         (WebKit::WebPage::changeAcceleratedCompositingMode):
2183
2184 2010-11-30  Ryosuke Niwa  <rniwa@webkit.org>
2185
2186         Unreviewed speculative build fix for Windows.
2187
2188         * UIProcess/win/WebView.cpp:
2189         (WebKit::WebView::pageDidEnterAcceleratedCompositing):
2190         (WebKit::WebView::pageDidLeaveAcceleratedCompositing):
2191         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary):
2192         * UIProcess/win/WebView.h:
2193
2194 2010-11-30  Anders Carlsson  <andersca@apple.com>
2195
2196         Fix Qt build.
2197
2198         * UIProcess/API/qt/qgraphicswkview.cpp:
2199         (QGraphicsWKView::takeSnapshot):
2200         (QGraphicsWKViewPrivate::commitScale):
2201
2202 2010-11-30  Anders Carlsson  <andersca@apple.com>
2203
2204         Reviewed by Sam Weinig.
2205
2206         Change DrawingArea and DrawingAreaProxy to not inherit from DrawingAreaBase
2207         https://bugs.webkit.org/show_bug.cgi?id=50300
2208
2209         * UIProcess/API/mac/WKView.mm:
2210         (-[WKView _switchToDrawingAreaTypeIfNecessary:DrawingAreaBase::]):
2211         (-[WKView _pageDidEnterAcceleratedCompositing]):
2212         (-[WKView _pageDidLeaveAcceleratedCompositing]):
2213         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
2214         (WebKit::ChunkedUpdateDrawingAreaProxy::ChunkedUpdateDrawingAreaProxy):
2215         * UIProcess/DrawingAreaProxy.cpp:
2216         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2217         (WebKit::DrawingAreaProxy::nextDrawingAreaID):
2218         * UIProcess/DrawingAreaProxy.h:
2219         (WebKit::DrawingAreaProxy::info):
2220         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
2221         (WebKit::LayerBackedDrawingAreaProxy::LayerBackedDrawingAreaProxy):
2222         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
2223         (WebKit::ChunkedUpdateDrawingArea::ChunkedUpdateDrawingArea):
2224         (WebKit::ChunkedUpdateDrawingArea::didReceiveMessage):
2225         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
2226         * WebProcess/WebPage/DrawingArea.cpp:
2227         (WebKit::DrawingArea::create):
2228         (WebKit::DrawingArea::DrawingArea):
2229         * WebProcess/WebPage/DrawingArea.h:
2230         (WebKit::DrawingArea::info):
2231         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
2232         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
2233         (WebKit::LayerBackedDrawingArea::didReceiveMessage):
2234         * WebProcess/WebPage/LayerBackedDrawingArea.h:
2235         * WebProcess/WebPage/TiledDrawingArea.cpp:
2236         (WebKit::TiledDrawingArea::TiledDrawingArea):
2237         * WebProcess/WebPage/TiledDrawingArea.h:
2238         * WebProcess/WebPage/WebPage.cpp:
2239         (WebKit::WebPage::changeAcceleratedCompositingMode):
2240
2241 2010-11-30  Simon Fraser  <simon.fraser@apple.com>
2242
2243         Reviewed by Sam Weinig.
2244
2245         Context menus broken after WebKit2 goes into accelerated composting mode.
2246         https://bugs.webkit.org/show_bug.cgi?id=50296
2247         
2248         Override hitTest: on the WKView to exclude the child layer-backed view from
2249         hit testing, so that context menus work.
2250
2251         * UIProcess/API/mac/WKView.mm:
2252         (-[WKView hitTest:]):
2253
2254 2010-11-30  Mark Rowe  <mrowe@apple.com>
2255
2256         Reviewed by Sam Weinig.
2257
2258         Build fix.
2259
2260         * Configurations/BaseTarget.xcconfig: Don't run Copy Files and Run Script build phases
2261         during installhdrs. It's not necessary, and it results in Xcode attempting to copy the
2262         plug-in shim dylib when it has not yet been built.
2263         * WebKit2.xcodeproj/project.pbxproj: Stop copying the .xcconfig file in to the application
2264         wrapper.
2265
2266 2010-11-30  Anders Carlsson  <andersca@apple.com>
2267
2268         Fix build.
2269
2270         * Scripts/webkit2/messages.py:
2271
2272 2010-11-30  Anders Carlsson  <andersca@apple.com>
2273
2274         Reviewed by Sam Weinig.
2275
2276         Rename DrawingAreaBase.h to DrawingAreaInfo.h.
2277
2278         * Shared/DrawingAreaInfo.h: Renamed from WebKit2/Shared/DrawingAreaBase.h.
2279         (WebKit::DrawingAreaBase::DrawingAreaInfo::DrawingAreaInfo):
2280         (WebKit::DrawingAreaBase::~DrawingAreaBase):
2281         (WebKit::DrawingAreaBase::info):
2282         (WebKit::DrawingAreaBase::DrawingAreaBase):
2283         * Shared/WebPageCreationParameters.h:
2284         * UIProcess/DrawingAreaProxy.h:
2285         * WebKit2.xcodeproj/project.pbxproj:
2286         * WebProcess/WebPage/DrawingArea.h:
2287         * win/WebKit2.vcproj:
2288
2289 2010-11-30  Anders Carlsson  <andersca@apple.com>
2290
2291         Fix build.
2292
2293         * PluginProcess/mac/PluginProcessShim.cpp:
2294
2295 2010-11-30  Anders Carlsson  <andersca@apple.com>
2296
2297         Reviewed by Dan Bernstein.
2298
2299         Add a simple shim function for Debugger().
2300         https://bugs.webkit.org/show_bug.cgi?id=50268
2301
2302         * PluginProcess/PluginProcess.h:
2303         * PluginProcess/mac/PluginProcessMac.mm:
2304         (WebKit::initShouldCallRealDebugger):
2305         We only want to call the real Debugger() function when USERBREAK is set.
2306
2307         (WebKit::shouldCallRealDebugger):
2308         Return whether USERBREAK is set.
2309         
2310         (WebKit::PluginProcess::initializeShim):
2311         Initialize the shim.
2312
2313         * PluginProcess/mac/PluginProcessMainMac.mm:
2314         (WebKit::PluginProcessMain):
2315         Call PluginProcess::initializeShim.
2316
2317         * PluginProcess/mac/PluginProcessShim.cpp:
2318         (WebKit::WebKitPluginProcessShimInitialize):
2319         This now takes a struct of callbacks.
2320
2321         (WebKit::shimDebugger):
2322         Call the shouldCallDebugger function. If it returns true, the real Debugger() function should be called.
2323
2324         * PluginProcess/mac/PluginProcessShim.h:
2325         * WebKit2.xcodeproj/project.pbxproj:
2326
2327 2010-11-30  Anders Carlsson  <andersca@apple.com>
2328
2329         Reviewed by Sam Weinig.
2330
2331         Pass the plug-in process shim in DYLD_INSERT_LIBRARIES when launching the plug-in process
2332         https://bugs.webkit.org/show_bug.cgi?id=50262
2333
2334         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2335         Add an EnvironmentVariables class that allows for easy modification of the environment variables
2336         passed to posix_spawn.
2337
2338         (WebKit::ProcessLauncher::launchProcess):
2339         When spawning the plug-in process, insert the plug-in process shim.
2340
2341 2010-11-30  Anders Carlsson  <andersca@apple.com>
2342
2343         Reviewed by Sam Weinig.
2344
2345         Add plug-in process shim
2346         https://bugs.webkit.org/show_bug.cgi?id=50261
2347
2348         * Configurations/PluginProcessShim.xcconfig: Added.
2349         * PluginProcess/mac/PluginProcessShim.cpp: Added.
2350         (PluginProcessShimInitialize):
2351         * PluginProcess/mac/PluginProcessShim.h: Added.
2352         * WebKit2.xcodeproj/project.pbxproj:
2353
2354 2010-11-30  Brian Weinstein  <bweinstein@apple.com>
2355
2356         Fix the Windows build by copying WKFindOptions.h into WebKitOutputDir with the other headers.
2357
2358         * win/WebKit2Generated.make:
2359
2360 2010-11-30  Dan Bernstein  <mitz@apple.com>
2361
2362         Try to fix the Windows build.
2363
2364         * win/WebKit2.vcproj:
2365
2366 2010-11-30  Dan Bernstein  <mitz@apple.com>
2367
2368         Reviewed by Anders Carlsson.
2369
2370         Injected bundle support for <rdar://problem/8710645> WebKitTestRunner needs layoutTestController.findString
2371         https://bugs.webkit.org/show_bug.cgi?id=50238
2372
2373         * Shared/API/c/WKFindOptions.h: Added. Moved the definition of WKFindOptions here from WKPage.h.
2374         * Shared/API/c/WKSharedAPICast.h:
2375         (WebKit::toFindOptions): Moved from WKAPICast.h.
2376         * UIProcess/API/C/WKAPICast.h:
2377         * UIProcess/API/C/WKPage.h:
2378         * WebKit2.xcodeproj/project.pbxproj: Added WKFindOptions.h.
2379         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2380         (WKBundlePageFindString): Added.
2381         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2382         * WebProcess/WebPage/WebPage.cpp:
2383         (WebKit::WebPage::findStringFromInjectedBundle): Added.
2384         * WebProcess/WebPage/WebPage.h:
2385
2386 2010-11-30  Andreas Kling  <kling@webkit.org>
2387
2388         Reviewed by Dirk Schulze.
2389
2390         GraphicsContext: Remove "current path" and have strokePath, fillPath and clipPath take a Path argument
2391         https://bugs.webkit.org/show_bug.cgi?id=48516
2392
2393         * UIProcess/FindIndicator.cpp:
2394         (WebKit::FindIndicator::draw):
2395
2396 2010-11-30  Steve Falkenburg  <sfalken@apple.com>
2397
2398         Reviewed by Adam Roben.
2399
2400         All projects on Windows should use cmd files for build events
2401         https://bugs.webkit.org/show_bug.cgi?id=50213
2402
2403         * win/WebKit2Common.vsprops:
2404         * win/WebKit2WebProcessCommon.vsprops:
2405         * win/WebKit2WebProcessPostBuild.cmd: Added.
2406         * win/WebKit2WebProcessPreBuild.cmd: Added.
2407         * win/WebKitPostBuild.cmd: Added.
2408         * win/WebKitPreBuild.cmd: Added.
2409         * win/WebKitPreLink.cmd: Added.
2410
2411 2010-11-30  Kenneth Rohde Christiansen  <kenneth@webkit.org>
2412
2413         Reviewed by Andreas Kling.
2414
2415         [Qt] Early return if setResizesToContentsUsingLayoutSize() is called with already-set size
2416
2417         * WebProcess/WebPage/WebPage.cpp:
2418         (WebKit::WebPage::setResizesToContentsUsingLayoutSize):
2419
2420 2010-11-29  Dan Bernstein  <mitz@apple.com>
2421
2422         Reviewed by Darin Adler.
2423
2424         WebKit2 part of <rdar://problem/8650085> adding word-prefix search options to the text search API.
2425         https://bugs.webkit.org/show_bug.cgi?id=50038
2426         Based on a patch from Darin Adler.
2427
2428         * Shared/WebFindOptions.h: Renamed FindOptions.h to this to account for WebCore’s new private
2429         FindOptions.h. Added and reordered FindOptions and rolled FindDirection into FindOptions.
2430         * UIProcess/API/C/WKAPICast.h: Removed toFindDirection().
2431         (WebKit::toFindOptions): Updated for new values.
2432         * UIProcess/API/C/WKPage.cpp:
2433         (WKPageFindString): Removed separate WKFindDirection.
2434         (WKPageCountStringMatches): Replaces caseInsensitive boolean with WKFindOptions.
2435         * UIProcess/API/C/WKPage.h: Removed WKFindDirection and updated WKFindOptions.
2436         * UIProcess/WebPageProxy.cpp:
2437         (WebKit::WebPageProxy::findString): Removed separate FindDirection.
2438         (WebKit::WebPageProxy::countStringMatches): Replaced caseInsensitive boolean with FindOptions.
2439         * UIProcess/WebPageProxy.h:
2440         * WebKit2.xcodeproj/project.pbxproj: Updated for the header rename.
2441         * WebProcess/WebPage/FindController.cpp:
2442         (WebKit::core): Added. Converts WebKit2 FindOptions to WebCore FindOptions.
2443         (WebKit::FindController::countStringMatches): Changed to use FindOptions.
2444         (WebKit::FindController::findString): Ditto.
2445         * WebProcess/WebPage/FindController.h:
2446         * WebProcess/WebPage/WebPage.cpp:
2447         (WebKit::WebPage::findString): Ditto.
2448         (WebKit::WebPage::countStringMatches): Ditto.
2449         * WebProcess/WebPage/WebPage.h:
2450         * WebProcess/WebPage/WebPage.messages.in: Ditto.
2451
2452 2010-11-29  Brent Fulgham  <bfulgham@webkit.org>
2453
2454         Unreviewed build fix.
2455
2456         * win/WebKit2.vcproj: Add missing vsprops association for
2457         Debug_Cairo_CFLite target.
2458
2459 2010-11-29  Anders Carlsson  <andersca@apple.com>
2460
2461         Reviewed by Sam Weinig.
2462
2463         Cursor does not always change back to arrow when exiting image document
2464         https://bugs.webkit.org/show_bug.cgi?id=50190
2465         <rdar://problem/8665265>
2466
2467         * Shared/mac/WebEventFactory.mm:
2468         (WebKit::mouseEventTypeForEvent):
2469         (WebKit::globalPointForEvent):
2470         (WebKit::pointForEvent):
2471         Handle the NSMouseEntered and NSMouseExited events.
2472
2473         * UIProcess/API/mac/WKView.mm:
2474         (-[WKView initWithFrame:pageNamespaceRef:hiddenFromInjectedBundle:]):
2475         We want entered and exited events for this tracking area.
2476         Add mouseEntered and mouseExited handlers.
2477
2478 2010-11-29  Anders Carlsson  <andersca@apple.com>
2479
2480         Reviewed by Darin Adler.
2481
2482         Should be able to pause and resume downloads
2483         https://bugs.webkit.org/show_bug.cgi?id=50185
2484         <rdar://problem/8691135>
2485
2486         * UIProcess/API/C/WKContext.h:
2487         Add didCancel callback.
2488
2489         * UIProcess/API/C/WKDownload.cpp:
2490         (WKDownloadGetResumeData):
2491         (WKDownloadCancel):
2492         Call the respective DownloadProxy member functions.
2493
2494         * UIProcess/API/C/WKDownload.h:
2495         * UIProcess/Downloads/DownloadProxy.cpp:
2496         (WebKit::DownloadProxy::cancel):
2497         Send Cancel to the WebProcess.
2498
2499         (WebKit::DownloadProxy::didFail):
2500         This now takes a resumeData reference.
2501
2502         (WebKit::DownloadProxy::didCancel):
2503         Set the resume data and call didCancel.
2504
2505         * UIProcess/Downloads/DownloadProxy.h:
2506         (WebKit::DownloadProxy::resumeData):
2507         Return the resume data.
2508
2509         * UIProcess/Downloads/DownloadProxy.messages.in:
2510         Add DidCancel message, Add resume data to DidFail.
2511
2512         * UIProcess/WebDownloadClient.cpp:
2513         (WebKit::WebDownloadClient::didCancel):
2514         Call the didCancel context client function.
2515
2516         * WebProcess/Downloads/Download.cpp:
2517         (WebKit::Download::didFail):
2518         This now takes a resume data argument as well.
2519         
2520         (WebKit::Download::didCancel):
2521         Send DidCancel.
2522
2523         * WebProcess/Downloads/DownloadManager.cpp:
2524         (WebKit::DownloadManager::cancelDownload):
2525         Look up the download and cancel it.
2526
2527         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
2528         (WebKit::Download::cancel):
2529         Add stub.
2530
2531         * WebProcess/Downloads/mac/DownloadMac.mm:
2532         (WebKit::Download::cancel):
2533         Cancel the download.
2534
2535         (-[WKDownloadAsDelegate download:didFailWithError:]):
2536         Pass the resume data along.
2537
2538         * WebProcess/Downloads/qt/DownloadQt.cpp:
2539         (WebKit::Download::cancel):
2540         Add stub.
2541
2542         * WebProcess/WebProcess.cpp:
2543         (WebKit::WebProcess::cancelDownload):
2544         Ask the download manager to cancel the download.
2545
2546         * WebProcess/WebProcess.h:
2547         * WebProcess/WebProcess.messages.in:
2548         Add CancelDownload message.
2549
2550 2010-11-29  Balazs Kelemen  <kbalazs@webkit.org>
2551
2552         Reviewed by Adam Roben.
2553
2554         [WK2] Support repeating timers
2555         https://bugs.webkit.org/show_bug.cgi?id=50024
2556
2557         Added boolean member for TimerBase on PLATFORM(WIN)
2558         and PLATFORM(QT) to be able to differentiate between
2559         repeating and one shot operating mode. Change the confusing
2560         signature of TimerBase::start: use a bool for selecting
2561         operating mode.
2562         * Platform/RunLoop.h:
2563         (RunLoop::TimerBase::startRepeating):
2564         (RunLoop::TimerBase::startOneShot):
2565         * Platform/mac/RunLoopMac.mm:
2566         (RunLoop::TimerBase::start):
2567         * Platform/qt/RunLoopQt.cpp:
2568         (RunLoop::TimerBase::timerFired): Only stop the timer if it
2569         is not in repeating mode.
2570         (RunLoop::TimerBase::TimerBase): 
2571         (RunLoop::TimerBase::start):
2572         * Platform/win/RunLoopWin.cpp:
2573         (RunLoop::TimerBase::timerFired):  Only stop the timer if it
2574         is not in repeating mode.
2575         (RunLoop::TimerBase::TimerBase):
2576         (RunLoop::TimerBase::start):
2577
2578 2010-11-29  Anders Carlsson  <andersca@apple.com>
2579
2580         Reviewed by Sam Weinig.
2581
2582         Downloads: When the web process crashes, call error callbacks for pending downloads
2583         https://bugs.webkit.org/show_bug.cgi?id=50164
2584         <rdar://problem/8691170>
2585
2586         * UIProcess/API/C/WKContext.h:
2587         Add processDidCrash callback.
2588
2589         * UIProcess/Downloads/DownloadProxy.cpp:
2590         (WebKit::DownloadProxy::~DownloadProxy):
2591         Assert that the web context is null.
2592
2593         (WebKit::DownloadProxy::processDidClose):
2594         Call the processDidCrash callback.
2595
2596         (WebKit::DownloadProxy::didFinish):
2597         (WebKit::DownloadProxy::didFail):
2598         Call downloadFinished.
2599
2600         * UIProcess/WebContext.cpp:
2601         (WebKit::WebContext::processDidClose):
2602         Call processDidClose on all pending downloads.
2603
2604         (WebKit::WebContext::downloadFinished):
2605         Remove the download proxy from the map.
2606
2607         * UIProcess/WebDownloadClient.cpp:
2608         (WebKit::WebDownloadClient::processDidCrash):
2609         Call the processDidCrash callback function.
2610
2611 2010-11-29  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2612
2613         Reviewed by Kenneth Rohde Christiansen.
2614
2615         [Qt] Allow pre-generation for package builds for WebKit2
2616         https://bugs.webkit.org/show_bug.cgi?id=50139
2617
2618         Use a build variable for the generated directory path and set the
2619         value based on CONFIG just like for WebKit1.
2620
2621         For non-package builds use a relative base path for the
2622         genrated directory just like for WebKit1.
2623
2624         * DerivedSources.pro:
2625         * WebKit2.pro:
2626
2627 2010-11-28  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2628
2629         Reviewed by Kenneth Rohde Christiansen.
2630
2631         [Qt] Move some build logic from Qt to platform independent code
2632         https://bugs.webkit.org/show_bug.cgi?id=50134
2633
2634         Remove the creation of the directories under $$OUTPUT_DIR/include
2635         as these will be handled by the fwheader_generator target.
2636
2637         Remove the explicit generation of $$OUTPUT_DIR/WebKit2/generated as
2638         this is not required.
2639
2640         * DerivedSources.pro:
2641
2642 2010-11-24  Brady Eidson  <beidson@apple.com>
2643
2644         Reviewed implicitly by John Sullivan.
2645
2646         https://bugs.webkit.org/show_bug.cgi?id=50042
2647
2648         * UIProcess/mac/WebContextMenuProxyMac.mm:
2649         (-[WebUserDataWrapper initWithUserData:WebKit::]): Do the proper self = [super init] dance here.
2650
2651 2010-11-24  Brady Eidson  <beidson@apple.com>
2652
2653         Reviewed by Dan Bernstein.
2654
2655         More of <rdar://problem/8613727> and https://bugs.webkit.org/show_bug.cgi?id=50042
2656         WK2 Context Menu Items need a user data object and a client callback for selection.
2657
2658         * Shared/API/c/WKContextMenuItem.cpp:
2659         (WKContextMenuItemGetUserData):
2660         (WKContextMenuItemSetUserData):
2661         * Shared/API/c/WKContextMenuItem.h:
2662
2663         * Shared/WebContextMenuItem.cpp:
2664         (WebKit::WebContextMenuItem::userData):
2665         (WebKit::WebContextMenuItem::setUserData):
2666         * Shared/WebContextMenuItem.h:
2667
2668         * Shared/WebContextMenuItemData.cpp:
2669         (WebKit::WebContextMenuItemData::userData):
2670         (WebKit::WebContextMenuItemData::setUserData):
2671         * Shared/WebContextMenuItemData.h:
2672
2673         * UIProcess/API/C/WKPage.h:
2674
2675         * UIProcess/WebPageContextMenuClient.cpp:
2676         (WebKit::WebPageContextMenuClient::customContextMenuItemSelected): Added for WK2 apps to get a callback.
2677         * UIProcess/WebPageContextMenuClient.h:
2678
2679         * UIProcess/WebPageProxy.cpp:
2680         (WebKit::WebPageProxy::contextMenuItemSelected):
2681         * UIProcess/mac/WebContextMenuProxyMac.mm:
2682         (-[WebUserDataWrapper initWithUserData:WebKit::]): Add an "APIObject" user data wrapper class to associate with the NSMenuItem.
2683         (-[WebUserDataWrapper WebKit::]):
2684         (-[WebMenuTarget forwardContextMenuAction:]): Include the user data object in the created ContextMenuItemData.
2685         (WebKit::nsMenuItemVector):
2686
2687 2010-11-24  Andras Becsi  <abecsi@inf.u-szeged.hu>
2688
2689         Reviewed by Kenneth Rohde Christiansen.
2690
2691         Make WebKit2 compile with !ENABLE(INSPECTOR).
2692         https://bugs.webkit.org/show_bug.cgi?id=49973
2693
2694         * Shared/API/c/WKSharedAPICast.h:
2695         (WebKit::toAPI):
2696         (WebKit::toImpl):
2697         * UIProcess/API/C/WKAPICast.h:
2698         * UIProcess/API/C/WKInspector.cpp:
2699         * UIProcess/API/C/WKInspector.h:
2700         * UIProcess/API/C/WKPage.cpp:
2701         * UIProcess/API/C/WKPage.h:
2702         * UIProcess/WebInspectorProxy.cpp:
2703         * UIProcess/WebInspectorProxy.h:
2704         * UIProcess/WebInspectorProxy.messages.in:
2705         * UIProcess/WebPageProxy.cpp:
2706         (WebKit::WebPageProxy::close):
2707         (WebKit::WebPageProxy::didReceiveMessage):
2708         (WebKit::WebPageProxy::didReceiveSyncMessage):
2709         (WebKit::WebPageProxy::processDidCrash):
2710         * UIProcess/WebPageProxy.h:
2711         * UIProcess/mac/WebInspectorProxyMac.mm:
2712         * UIProcess/qt/WebInspectorProxyQt.cpp:
2713         * UIProcess/win/WebInspectorProxyWin.cpp:
2714         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2715         * WebProcess/WebCoreSupport/WebInspectorClient.h:
2716         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
2717         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
2718         * WebProcess/WebPage/WebInspector.cpp:
2719         * WebProcess/WebPage/WebInspector.h:
2720         * WebProcess/WebPage/WebInspector.messages.in:
2721         * WebProcess/WebPage/WebPage.cpp:
2722         (WebKit::WebPage::WebPage):
2723         (WebKit::WebPage::close):
2724         (WebKit::WebPage::windowIsFocused):
2725         (WebKit::WebPage::didReceiveMessage):
2726         * WebProcess/WebPage/WebPage.h:
2727         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
2728         * WebProcess/WebPage/win/WebInspectorWin.cpp:
2729
2730 2010-11-24  Andreas Kling  <kling@webkit.org>
2731
2732         Reviewed by Kenneth Rohde Christiansen.
2733
2734         [Qt][WK2] Make deep copies of tile images
2735
2736         We need the tile images we get from UpdateChunk::createImage() to persist,
2737         so we should take a copy() of them.
2738
2739         * UIProcess/qt/TiledDrawingAreaTileQt.cpp:
2740         (WebKit::TiledDrawingAreaTile::updateFromChunk):
2741
2742 2010-11-24  Andreas Kling  <kling@webkit.org>
2743
2744         Reviewed by Kenneth Rohde Christiansen.
2745
2746         [Qt] Fix uninitialized variable in QGraphicsWKViewPrivate
2747
2748         Always initialize QGWKVP::m_isChangingScale in the constructor.
2749
2750         * UIProcess/API/qt/qgraphicswkview.cpp:
2751         (QGraphicsWKViewPrivate::QGraphicsWKViewPrivate):
2752
2753 2010-11-23  Kenneth Rohde Christiansen  <kenneth@webkit.org>
2754
2755         Reviewed by Andreas Kling.
2756
2757         Adapt to setShouldDelegateScrolling not being a real setting anymore.
2758         We now similarily to setUseFixedLayout and setPaintEntireContents
2759         set it on the FrameView wen transitioning to a new page, etc.
2760
2761         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2762         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
2763         * WebProcess/WebPage/WebPage.cpp:
2764         (WebKit::WebPage::setResizesToContentsUsingLayoutSize):
2765
2766 2010-11-22  Adam Roben  <aroben@apple.com>
2767
2768         Use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops files
2769
2770         Apple's Windows build allows placing header files and import libraries for WebKit's
2771         dependencies (CoreGraphics, CFNetwork, SQLite, etc.) outside the source tree via the
2772         $WebKitLibrariesDir environment variable. This is both required for production builds and
2773         convenient for Apple-internal developer builds. Apple's production builds also require that
2774         WebKit's shared .vsprops files be accessed relative to $WebKitLibrariesDir. In production
2775         builds, the files are copied into that directory tree by the
2776         WebKitLibraries/win/tools/WinTools.make file. In Apple-internal developer builds, the
2777         copying is done by
2778         JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make.
2779
2780         This .vsprops copying is problematic in one very important case: when a developer updates
2781         their source tree and then tries to build. Visual Studio only reads .vsprops files when a
2782         project is first loaded. So, when Visual Studio is first opened after the .vsprops files are
2783         updated, it reads in the old files that were already residing in $WebKitLibrariesDir. When a
2784         build is started, JavaScriptCoreGenerated.make copies the new .vsprops files into
2785         $WebKitLibrariesDir, but Visual Studio will not pick up the changes.  The rest of the build
2786         will proceed with out-of-date .vsprops files, which will likely result in a build failure.
2787
2788         To fix this, we now use normal relative paths to access the .vsprops files in the source
2789         tree rather than in $WebKitLibrariesDir, but prefix those paths with a new environment
2790         variable, $WebKitVSPropsRedirectionDir. In developer builds, this environment variable is
2791         unset, so the normal relative paths are used to read the .vsprops files out of the source
2792         tree directly. In production builds, this environment variable is set to a fake directory
2793         that will cause the .vsprops files in $WebKitLibrariesDir to be found when the relative path
2794         is resolved.
2795         
2796         For example, JavaScriptCore.vcproj uses this path for FeatureDefines.vsprops:
2797
2798         $(WebKitVSPropsRedirectionDir)..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
2799
2800         In developer builds, where $WebKitVSPropsRedirectionDir is unset, this will point to the
2801         files in WebKitLibraries\win\tools\vsprops in the source tree. In production builds,
2802         JavaScriptCore.make sets $WebKitVSPropsRedirectionDir to
2803         "$(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\1\2\3\", so the full path for
2804         FeatureDefines.vsprops becomes:
2805
2806         $(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\1\2\3\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
2807
2808         which resolves to:
2809
2810         $(SRCROOT)\AppleInternal\tools\vsprops\OpenSource\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops
2811
2812         (We rely on the fact that Windows doesn't care whether the directories "1", "2", and "3"
2813         actually exist since they are matched by an equal number of ".." path components.)
2814
2815         Note that Visual Studio still won't pick up changes made to .vsprops files while Visual
2816         Studio is open, but that problem hasn't seemed to cause developers many headaches so far.
2817
2818         Fixes <http://webkit.org/b/49181> Windows build fails mysteriously when .vsprops files are
2819         updated
2820
2821         Reviewed by Dave Hyatt.
2822
2823         * win/WebKit2.make: Set $WebKitVSPropsRedirectionDir so that production builds can
2824         find the .vsprops files.
2825
2826         * win/WebKit2.vcproj:
2827         * win/WebKit2WebProcess.vcproj:
2828         Changed to use paths relative to $WebKitVSPropsRedirectionDir to access shared .vsprops
2829         files.
2830
2831 2010-11-22  Kenneth Rohde Christiansen  <kenneth@webkit.org>
2832
2833         Reviewed by Andreas Kling.
2834
2835         Make WebKit2 compile with ENABLE_JAVASCRIPT_DEBUGGER=0
2836
2837         * WebProcess/WebPage/WebInspector.cpp: Add missing ENABLE(JAVASCRIPT_DEBUGGER) guards.
2838         (WebKit::WebInspector::startJavaScriptDebugging):
2839         (WebKit::WebInspector::stopJavaScriptDebugging):
2840         (WebKit::WebInspector::startJavaScriptProfiling):
2841         (WebKit::WebInspector::stopJavaScriptProfiling):
2842
2843 2010-11-21  Sam Weinig  <sam@webkit.org>
2844
2845         Reviewed by Dan Bernstein.
2846
2847         Textareas should be resizable by default
2848         https://bugs.webkit.org/show_bug.cgi?id=49892
2849
2850         Test: WebKit2/WKPreferences
2851
2852         * Shared/WebPreferencesStore.cpp:
2853         (WebKit::WebPreferencesStore::WebPreferencesStore):
2854         (WebKit::WebPreferencesStore::encode):
2855         (WebKit::WebPreferencesStore::decode):
2856         * Shared/WebPreferencesStore.h:
2857         Add textAreasAreResizable bit.
2858
2859         * UIProcess/API/C/WKPreferences.cpp:
2860         (WKPreferencesSetJavaEnabled):
2861         (WKPreferencesGetJavaEnabled):
2862         Fix typo, WKPRe... -> WKPre...
2863
2864         (WKPreferencesSetMinimumFontSize):
2865         (WKPreferencesGetMinimumFontSize):
2866         Fix comment to correctly reflect that the default minimumFontSize is 0, not 1.
2867
2868         (WKPreferencesSetTextAreasAreResizable):
2869         (WKPreferencesGetTextAreasAreResizable):
2870         * UIProcess/API/C/WKPreferences.h:
2871         Add API.
2872
2873         * UIProcess/API/C/WKPreferencesPrivate.h:
2874         Don't use PLATFORM in API headers.
2875
2876         * UIProcess/WebPreferences.cpp:
2877         (WebKit::WebPreferences::setTextAreasAreResizable):
2878         (WebKit::WebPreferences::textAreasAreResizable):
2879         * UIProcess/WebPreferences.h:
2880         * WebProcess/WebPage/WebPage.cpp:
2881         (WebKit::WebPage::updatePreferences):
2882         Pipe bit through to the WebProcess and onto WebCore::Settings.
2883
2884 2010-11-19  Zalan Bujtas  <zbujtas@gmail.com>
2885
2886         Reviewed by Andreas Kling.
2887
2888         WebUIClient::createNewPage() expects a retained WKPageRef. 
2889         https://bugs.webkit.org/show_bug.cgi?id=48549
2890
2891         * UIProcess/API/qt/ClientImpl.cpp:
2892         (qt_wk_createNewPage):
2893
2894 2010-11-19  Anders Carlsson  <andersca@apple.com>
2895
2896         Reviewed by Sam Weinig.
2897
2898         Add a didFail WKContextDownloadClient callback
2899         https://bugs.webkit.org/show_bug.cgi?id=49847
2900
2901         * UIProcess/API/C/WKContext.h:
2902         Add didFail callback.
2903
2904         * UIProcess/Downloads/DownloadProxy.cpp:
2905         (WebKit::DownloadProxy::didFail):
2906         Call WebDownloadClient::didFail.
2907
2908         * UIProcess/WebDownloadClient.cpp:
2909         (WebKit::WebDownloadClient::didFail):
2910         Call the didFail client function.
2911
2912
2913 2010-11-19  Anders Carlsson  <andersca@apple.com>
2914
2915         Reviewed by Sam Weinig.
2916
2917         Extend sandbox when downloading files
2918         https://bugs.webkit.org/show_bug.cgi?id=49844
2919
2920         * Platform/CoreIPC/HandleMessage.h:
2921         (CoreIPC::callMemberFunction):
2922         Add new overload.
2923
2924         * UIProcess/Downloads/DownloadProxy.cpp:
2925         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
2926         Create a sandbox extension handle if necessary.
2927
2928         * UIProcess/Downloads/DownloadProxy.messages.in:
2929         Add a sandbox extension handle out parameter to the DecideDestinationWithSuggestedFilename message.
2930
2931         * WebProcess/Downloads/Download.cpp:
2932         (WebKit::Download::decideDestinationWithSuggestedFilename):
2933         Create and consume the returned sandbox extension handle.
2934
2935         (WebKit::Download::didFinish):
2936         (WebKit::Download::didFail):
2937         Invalidate the sandbox extension handles.
2938
2939         * WebProcess/Downloads/mac/DownloadMac.mm:
2940         (-[WKDownloadAsDelegate download:shouldDecodeSourceDataOfMIMEType:]):
2941         Whoops, fix inverted logic.
2942
2943 2010-11-19  Steve Falkenburg  <sfalken@apple.com>
2944
2945         Reviewed by Adam Roben.
2946
2947         Add Debug_Cairo_CFLite and Release_Cairo_CFLite configurations for all vcproj files
2948         https://bugs.webkit.org/show_bug.cgi?id=49819
2949
2950         * win/WebKit2.vcproj:
2951         * win/WebKit2Generated.vcproj:
2952         * win/WebKit2WebProcess.vcproj:
2953         * win/WebKit2WebProcessCommon.vsprops:
2954
2955 2010-11-19  Brady Eidson  <beidson@apple.com>
2956
2957         Reviewed by Darin Adler.
2958
2959         More of <rdar://problem/8613727> and https://bugs.webkit.org/show_bug.cgi?id=49836
2960         Add WebKit2 API relevant to customization of context menus
2961
2962         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2963         (WKBundleFrameAllowsFollowingLink):
2964         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
2965
2966         * WebProcess/WebPage/WebFrame.cpp:
2967         (WebKit::WebFrame::allowsFollowingLink):
2968         * WebProcess/WebPage/WebFrame.h:
2969
2970 2010-11-19  Brady Eidson  <beidson@apple.com>
2971
2972         Reviewed by Darin Adler.
2973
2974         <rdar://problem/8613727> and https://bugs.webkit.org/show_bug.cgi?id=49836
2975         Add WebKit2 API relevant to customization of context menus
2976
2977         Most of this is just exposing already-existing concepts in API.
2978
2979         * Shared/API/c/WKURLRequest.cpp:
2980         (WKURLRequestCreateWithWKURL):
2981         * Shared/API/c/WKURLRequest.h:
2982
2983         * Shared/WebURLRequest.cpp:
2984         (WebKit::WebURLRequest::create):
2985         * Shared/WebURLRequest.h:
2986
2987         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
2988         (WKBundleHitTestResultCopyAbsoluteImageURL):
2989         (WKBundleHitTestResultCopyAbsoluteMediaURL):
2990         (WKBundleHitTestResultGetImageRect):
2991         (WKBundleHitTestResultGetIsSelected):
2992         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
2993
2994         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2995         (WKBundlePageHasLocalDataForURL):
2996         (WKBundlePageCanHandleRequest):
2997         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2998
2999         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
3000         (WebKit::InjectedBundleHitTestResult::absoluteImageURL):
3001         (WebKit::InjectedBundleHitTestResult::absoluteMediaURL):
3002         (WebKit::InjectedBundleHitTestResult::imageRect):
3003         (WebKit::InjectedBundleHitTestResult::isSelected):
3004         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
3005
3006         * WebProcess/WebPage/WebContextMenu.cpp:
3007         (WebKit::WebContextMenu::show):
3008
3009         * WebProcess/WebPage/WebPage.h:
3010         * WebProcess/WebPage/mac/WebPageMac.mm:
3011         (WebKit::WebPage::hasLocalDataForURL):
3012         (WebKit::WebPage::canHandleRequest):
3013         * WebProcess/WebPage/qt/WebPageQt.cpp:
3014         (WebKit::WebPage::hasLocalDataForURL): Stubbed for now.
3015         (WebKit::WebPage::canHandleRequest): Ditto.
3016         * WebProcess/WebPage/win/WebPageWin.cpp:
3017         (WebKit::WebPage::hasLocalDataForURL): Ditto.
3018         (WebKit::WebPage::canHandleRequest): Ditto.
3019
3020 2010-11-19  Darin Adler  <darin@apple.com>
3021
3022         Reviewed by Sam Weinig.
3023
3024         Need a way to clear disk cache from WebContext
3025         https://bugs.webkit.org/show_bug.cgi?id=49820
3026
3027         * UIProcess/API/C/WKContext.cpp:
3028         (WKContextClearResourceCaches): Added.
3029         (WKContextClearApplicationCache): Added.
3030         * UIProcess/API/C/WKContext.h:
3031         * UIProcess/WebContext.cpp:
3032         (WebKit::WebContext::clearResourceCaches): Added.
3033         (WebKit::WebContext::clearApplicationCache): Added.
3034         * UIProcess/WebContext.h:
3035         * WebProcess/WebProcess.cpp:
3036         (WebKit::WebProcess::clearResourceCaches): Added.
3037         (WebKit::WebProcess::clearApplicationCache): Added.
3038         * WebProcess/WebProcess.h:
3039         * WebProcess/WebProcess.messages.in: Added messages.
3040         * WebProcess/mac/WebProcessMac.mm:
3041         (WebKit::WebProcess::platformClearResourceCaches): Added.
3042         * WebProcess/qt/WebProcessQt.cpp:
3043         (WebKit::WebProcess::platformClearResourceCaches): Added.
3044         * WebProcess/win/WebProcessWin.cpp:
3045         (WebKit::WebProcess::platformClearResourceCaches): Added.
3046
3047 2010-11-19  Anders Carlsson  <andersca@apple.com>
3048
3049         Reviewed by Sam Weinig.
3050
3051         Implement support for loading local files
3052         https://bugs.webkit.org/show_bug.cgi?id=49828
3053         <rdar://problem/8447121>
3054
3055         * UIProcess/WebPageProxy.cpp:
3056         (WebKit::initializeSandboxExtensionHandle):
3057         Given an URL, create a sandbox extension if it's a local file URL.
3058
3059         (WebKit::WebPageProxy::loadURL):
3060         (WebKit::WebPageProxy::loadURLRequest):
3061         Pass along sandbox extension handles to the LoadURL and LoadURLRequest messages.
3062         
3063         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3064         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
3065         Call SandboxExtensionTracker::didStartProvisionalLoad.
3066
3067         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
3068         Call SandboxExtensionTracker::didCommitProvisionalLoad.
3069
3070         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
3071         Call SandboxExtensionTracker::didFailProvisionalLoad.
3072
3073         * WebProcess/WebPage/WebPage.cpp:
3074         (WebKit::WebPage::~WebPage):
3075         Invalidate the sandbox extension tracker.
3076
3077         (WebKit::WebPage::close):
3078         Invalidate the sandbox extension tracker.
3079
3080         (WebKit::WebPage::loadURL):
3081         (WebKit::WebPage::loadURLRequest):
3082         Pass the sandbox extension handle to the sandbox extension tracker.
3083
3084         (WebKit::WebPage::SandboxExtensionTracker::~SandboxExtensionTracker):
3085         Invalidate the sandbox extension tracker.
3086
3087         (WebKit::WebPage::SandboxExtensionTracker::invalidate):
3088         invalidate ell the sandbox extensions.
3089         
3090         (WebKit::WebPage::SandboxExtensionTracker::beginLoad):
3091         Create a sandbox extension and store it as the "pending provisional extension".
3092
3093         (WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad):
3094         Consume the pending provisional extension and make it the provisional extension.
3095
3096         (WebKit::WebPage::SandboxExtensionTracker::didCommitProvisionalLoad):
3097         Invalidate the committed extension and make the provisional extension the committed extension.
3098
3099         (WebKit::WebPage::SandboxExtensionTracker::didFailProvisionalLoad):
3100         Invalidate the provisional extension.
3101
3102         * WebProcess/WebPage/WebPage.messages.in:
3103         Add SandboxExtension::Handle parameters to LoadURL and LoadURLRequest.
3104
3105 2010-11-19  Anders Carlsson  <andersca@apple.com>
3106
3107         Reviewed by Darin Adler.
3108
3109         Make it possible to encode null SandboxExtension handles
3110         https://bugs.webkit.org/show_bug.cgi?id=49825
3111
3112         * Shared/mac/SandboxExtensionMac.mm:
3113         (WebKit::SandboxExtension::Handle::encode):
3114         If there's no underlying sandbox extension, just encode an empty byte array.
3115
3116         (WebKit::SandboxExtension::Handle::decode):
3117         If the decoded byte array is empty, don't try to create a sandbox extension.
3118
3119         (WebKit::SandboxExtension::create):
3120         If the handle is null, return null.
3121
3122         (WebKit::SandboxExtension::consume):
3123         Consuming shuld not null out the underlying sandbox extension object.
3124
3125 2010-11-19  Steve Falkenburg  <sfalken@apple.com>
3126
3127         Reviewed by Darin Adler.
3128
3129         Normalize Cairo/CFLite project/solution configuration names
3130         https://bugs.webkit.org/show_bug.cgi?id=49818
3131
3132         * win/WebKit2.vcproj:
3133         * win/WebKit2WebProcess.vcproj:
3134
3135 2010-11-19  Anders Carlsson  <andersca@apple.com>
3136
3137         Reviewed by Sam Weinig.
3138
3139         Add SandboxExtension abstraction and use it for the injected bundle extension
3140         https://bugs.webkit.org/show_bug.cgi?id=49817
3141
3142         * Shared/SandboxExtension.h:
3143         Add SandboxExtension abstraction.
3144         
3145         * Shared/WebProcessCreationParameters.cpp:
3146         (WebKit::WebProcessCreationParameters::encode):
3147         (WebKit::WebProcessCreationParameters::decode):
3148         * Shared/WebProcessCreationParameters.h:
3149         Instead of encoding/decoding a token, encode/decode the sandbox extension handle.
3150
3151         * Shared/mac/SandboxExtensionMac.mm: Added.
3152         Add Mac implementation of SandboxExtension.
3153
3154         * UIProcess/WebContext.cpp:
3155         (WebKit::WebContext::ensureWebProcess):
3156         Create a SandboxExtension::Handle object.
3157
3158         * WebKit2.xcodeproj/project.pbxproj:
3159         Add new files.
3160         
3161         * WebProcess/InjectedBundle/InjectedBundle.h:
3162         (WebKit::InjectedBundle::setSandboxExtension):
3163         Set the sandbox extension.
3164
3165         * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
3166         (WebKit::InjectedBundle::load):
3167         Consume the sandbox extension.
3168
3169         * WebProcess/WebProcess.cpp:
3170         (WebKit::WebProcess::initializeWebProcess):
3171         Create a sandbox extension and set it on the injected bundle.
3172
3173 2010-11-18  Steve Falkenburg  <sfalken@apple.com>
3174
3175         Reviewed by Adam Roben.
3176
3177         Windows vcproj configuration names should be normalized across projects
3178         https://bugs.webkit.org/show_bug.cgi?id=49776
3179
3180         * win/WebKit2.submit.sln:
3181         * win/WebKit2Generated.vcproj:
3182         * win/WebKit2GeneratedCommon.vsprops: Added.
3183
3184 2010-11-18  Anders Carlsson  <andersca@apple.com>
3185
3186         Reviewed by Adam Roben.
3187
3188         Crash in WebKit::PluginView::manualLoadDidReceiveResponse when navigating to a .wav file in WebKit2 on Mac
3189         https://bugs.webkit.org/show_bug.cgi?id=48559
3190         <rdar://problem/8606622>
3191
3192         Add null checks for m_plugin.
3193
3194         * WebProcess/Plugins/PluginView.cpp:
3195         (WebKit::PluginView::manualLoadDidReceiveResponse):
3196         (WebKit::PluginView::manualLoadDidReceiveData):
3197         (WebKit::PluginView::manualLoadDidFinishLoading):
3198         (WebKit::PluginView::manualLoadDidFail):
3199
3200 2010-11-18  Mark Rowe  <mrowe@apple.com>
3201
3202         Rubber-stamped by Adam Roben.
3203
3204         <rdar://problem/8602509&8602717&8602724> Enable compaction support.
3205
3206         * Configurations/WebKit2.xcconfig:
3207
3208 2010-11-18  Brian Weinstein  <bweinstein@apple.com>
3209
3210         Reviewed by Adam Roben.
3211
3212          WebKit2: Safari shouldn't auto-activate plug-ins in background tabs.
3213          https://bugs.webkit.org/show_bug.cgi?id=49770
3214          <rdar://problem/8482424>
3215          
3216          Add an API on Windows to call setIsInWindow, which calls through to WebPage::setIsInWindow.
3217          Remove the !PLATFORM(WIN) check in WebPage, so we don't automatically start plugins that are
3218          loaded in background tabs.
3219
3220         * UIProcess/API/C/win/WKView.cpp:
3221         (WKViewSetIsInWindow): Call through to WebView::setIsInWindow.
3222         * UIProcess/API/C/win/WKView.h:
3223         * UIProcess/win/WebView.cpp:
3224         (WebKit::WebView::setIsInWindow): Call through to WebPage::setIsInWindow.
3225         * UIProcess/win/WebView.h:
3226         * WebProcess/WebPage/WebPage.cpp:
3227         (WebKit::WebPage::WebPage): Remove the !PLATFORM(WIN) check and update the comment.
3228
3229 2010-11-18  Darin Adler  <darin@apple.com>
3230
3231         * WebProcess/WebPage/WebPage.cpp: Fix build by rolling out a change.
3232
3233 2010-11-18  Darin Adler  <darin@apple.com>
3234
3235         Reviewed by Kevin Decker.
3236
3237         REGRESSION (WebKit2): Plug-ins and <video> start playing immediately in background tabs
3238         https://bugs.webkit.org/show_bug.cgi?id=49766
3239
3240         Test: manual-tests/resources/video-tab.html
3241
3242         * WebProcess/WebPage/WebPage.cpp:
3243         (WebKit::WebPage::WebPage): Call setCanStartMedia(false) since the rest of the code
3244         starts out treating the page as "not in a window".
3245
3246 2010-11-18  Steve Falkenburg  <sfalken@apple.com>
3247
3248         Reviewed by Adam Roben.
3249
3250         Remove leftover Windows Debug_Internal configurations
3251         https://bugs.webkit.org/show_bug.cgi?id=49758
3252
3253         * win/WebKit2.vcproj:
3254         * win/WebKit2WebProcess.vcproj:
3255
3256 2010-11-18  Anders Carlsson  <andersca@apple.com>
3257
3258         Reviewed by John Sullivan.
3259
3260         Page overlays should be able to handle mouse events
3261         https://bugs.webkit.org/show_bug.cgi?id=49756
3262
3263         * Shared/API/c/WKSharedAPICast.h:
3264         (WebKit::toAPI):
3265         Add API cast function for converting an IntPoint to a WKPoint.
3266
3267         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3268         (PageOverlayClientImpl::mouseEvent):
3269         Call the appropriate callbacks.
3270
3271         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
3272         Add new callbacks.
3273
3274 2010-11-18  Anders Carlsson  <andersca@apple.com>
3275
3276         Reviewed by Sam Weinig.
3277
3278         Keep the web process alive if there are active downloads
3279         https://bugs.webkit.org/show_bug.cgi?id=49755
3280
3281         Make sure that Download objects are destroyed when the download finishes or fails.
3282         Don't close the web process if there are live Download objects.
3283         
3284         * UIProcess/Downloads/DownloadProxy.cpp:
3285         (WebKit::DownloadProxy::didFail):
3286         Add stub.
3287
3288         * UIProcess/Downloads/DownloadProxy.h:
3289         * UIProcess/Downloads/DownloadProxy.messages.in:
3290         Add DidFail message.
3291
3292         * WebProcess/Downloads/Download.cpp:
3293         (WebKit::Download::didFinish):
3294         Call DownloadManager::downloadFinished.
3295
3296         (WebKit::Download::didFail):
3297         Send DidFail message and call DownloadManager::downloadFinished.
3298         
3299         * WebProcess/Downloads/Download.h:
3300         (WebKit::Download::destinationID):
3301         Call downloadID().
3302
3303         (WebKit::Download::downloadID):
3304         Return the download ID.
3305
3306         * WebProcess/Downloads/DownloadManager.cpp:
3307         (WebKit::DownloadManager::downloadFinished):
3308         Delete the Download object and call WebProcess::shutdownIfPossible.
3309
3310         * WebProcess/Downloads/DownloadManager.h:
3311         (WebKit::DownloadManager::isDownloading):
3312         Return whether the download manager has any active downloads.
3313
3314         * WebProcess/Downloads/mac/DownloadMac.mm:
3315         (-[WKDownloadAsDelegate download:didFailWithError:]):
3316         Call Download::didFail.
3317
3318         * WebProcess/WebProcess.cpp:
3319         (WebKit::WebProcess::removeWebPage):
3320         Call shutdownIfPossible.
3321
3322         (WebKit::WebProcess::shutdownIfPossible):
3323         New function. Don't shutdown if there are live pages or active downloads.
3324
3325         * WebProcess/WebProcess.h:
3326
3327 2010-11-18  Steve Falkenburg  <sfalken@apple.com>
3328
3329         Reviewed by Adam Roben.
3330
3331         Debug_Internal Windows configuration is unnecessary, should be removed
3332         https://bugs.webkit.org/show_bug.cgi?id=49753
3333
3334         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
3335         * WebKit2Prefix.h:
3336
3337 2010-11-18  Steve Falkenburg  <sfalken@apple.com>
3338
3339         Reviewed by Adam Roben.
3340
3341         Clean up vcproj errors
3342         https://bugs.webkit.org/show_bug.cgi?id=49741
3343
3344         * win/WebKit2WebProcess.vcproj:
3345
3346 2010-11-18  Benjamin Poulain  <benjamin.poulain@nokia.com>
3347
3348         Reviewed by Laszlo Gombos.
3349
3350         [Qt] [WK2] WebKit 2 would not compile for Qt without ENABLE_TOUCH_EVENT
3351         https://bugs.webkit.org/show_bug.cgi?id=49664
3352
3353         Move the ENABLE(TOUCH_EVENTS) to the code where internal WebKit touch
3354         types are used.
3355
3356         * UIProcess/API/qt/qgraphicswkview.cpp:
3357         (QGraphicsWKView::touchEvent):
3358         * UIProcess/API/qt/qwkpage.cpp:
3359         (QWKPagePrivate::touchEvent):
3360
3361 2010-11-17  Andreas Kling  <kling@webkit.org>
3362
3363         Reviewed by Kenneth Rohde Christiansen.
3364
3365         Reuse the size of the actualVisibleContentRect when loading a new page
3366         or navigating session history.
3367
3368         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3369         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3370
3371 2010-11-17  Dimitri Glazkov  <dglazkov@chromium.org>
3372
3373         Reviewed by Darin Adler.
3374
3375         Converge means of querying a parent node into one way, which is Node::parentNode.
3376         https://bugs.webkit.org/show_bug.cgi?id=49686
3377
3378         * WebProcess/WebPage/WebPage.cpp: Changed to use parentNode.
3379         (WebKit::WebPage::findZoomableAreaForPoint): Ditto.
3380
3381 2010-11-17  Timothy Hatcher  <timothy@apple.com>
3382
3383         Remove duplicate Web Inspector message handeling in WebPage::didReceiveMessage.
3384
3385         https://webkit.org/b/49689
3386
3387         Reviewed by Andreas Kling.
3388
3389         * WebProcess/WebPage/WebPage.cpp:
3390         (WebKit::WebPage::didReceiveMessage): Remove duplicate code.
3391
3392 2010-11-17  Timothy Hatcher  <timothy@apple.com>
3393
3394         Fix a crash when closing the inspected page when the Web Inspector
3395         page was never created.
3396
3397         https://bugs.webkit.org/show_bug.cgi?id=49687
3398
3399         Reviewed by John Sullivan.
3400
3401         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3402         (WebKit::WebInspectorClient::sendMessageToFrontend): Null check the Inspector WebPage.
3403
3404 2010-11-17  Anders Carlsson  <andersca@apple.com>
3405
3406         Reviewed by John Sullivan.
3407
3408         Don't crash when invalidating a page overlay that hasn't been installed yet
3409         https://bugs.webkit.org/show_bug.cgi?id=49685
3410
3411         Null check the web page.
3412
3413         * WebProcess/WebPage/PageOverlay.cpp:
3414         (WebKit::PageOverlay::setNeedsDisplay):
3415
3416 2010-11-17  Brady Eidson  <beidson@apple.com>
3417
3418         Reviewed by Darin Adler.
3419
3420         https://bugs.webkit.org/show_bug.cgi?id=49682 - Expose "removeItemAtIndex" in WKMutableArray
3421
3422         * Shared/API/c/WKMutableArray.cpp:
3423         (WKArrayRemoveItemAtIndex):
3424         * Shared/API/c/WKMutableArray.h:
3425
3426         * Shared/MutableArray.cpp:
3427         (WebKit::MutableArray::removeItemAtIndex):
3428         * Shared/MutableArray.h:
3429
3430 2010-11-17  Brady Eidson  <beidson@apple.com>
3431
3432         Reviewed by Anders Carlsson.
3433
3434         https://bugs.webkit.org/show_bug.cgi?id=49683 - Export WKContextMenuItem and WKContextMenuItemTypes as public headers
3435
3436         * WebKit2.xcodeproj/project.pbxproj:
3437
3438 2010-11-17  Anders Carlsson  <andersca@apple.com>
3439
3440         Reviewed by Darin Adler.
3441
3442         Need way to invalidate part of a WKOverlayRef so it will be redrawn
3443         https://bugs.webkit.org/show_bug.cgi?id=49679
3444         <rdar://problem/8679152>
3445
3446         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3447         (WKBundlePageOverlaySetNeedsDisplay):
3448         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
3449         * WebProcess/WebPage/PageOverlay.cpp:
3450         (WebKit::PageOverlay::setNeedsDisplay):
3451         * WebProcess/WebPage/PageOverlay.h:
3452
3453 2010-11-17  Timothy Hatcher  <timothy@apple.com>
3454
3455         Provide a way to create a WKView (WebPage) that is hidden from
3456         the InjectedBundle. This is needed for the Web Inspector.
3457
3458         https://webkit.org/b/49670
3459
3460         Reviewed by Sam Weinig.
3461
3462         * Shared/WebPageCreationParameters.cpp:
3463         (WebKit::WebPageCreationParameters::encode): Added visibleToInjectedBundle.
3464         (WebKit::WebPageCreationParameters::decode): Ditto.
3465         * Shared/WebPageCreationParameters.h: Ditto.
3466         * UIProcess/API/C/win/WKView.cpp:
3467         (WKViewCreate): Pass VisibleToInjectedBundle to the WebView create function.
3468         * UIProcess/API/C/win/WKViewPrivate.cpp:
3469         (WKViewCreateForWebInspector): Added. Not used yet. Passes HiddenFromInjectedBundle
3470         to the WebView create function.
3471         * UIProcess/API/C/win/WKViewPrivate.h: Added WKViewCreateForWebInspector.
3472         * UIProcess/API/mac/WKView.mm:
3473         (-[WKView initWithFrame:pageNamespaceRef:hiddenFromInjectedBundle:]): Added hiddenFromInjectedBundle
3474         parameter and calls WebPageProxy::setVisibleToInjectedBundle.
3475         (-[WKView initWithFrame:pageNamespaceRef:]): Calls initWithFrame:pageNamespaceRef:hiddenFromInjectedBundle:
3476         and passes NO for hiddenFromInjectedBundle.
3477         (-[WKView initWithFrame:]): Cleaned up by removing the local assignment to self and just returns the result.
3478         * UIProcess/API/mac/WKViewInternal.h: Added initWithFrame:pageNamespaceRef:hiddenFromInjectedBundle:.
3479         * UIProcess/WebPageProxy.cpp:
3480         (WebKit::WebPageProxy::WebPageProxy): Initialize m_visibleToInjectedBundle from the creation parameters.
3481         (WebKit::WebPageProxy::creationParameters): Set visibleToInjectedBundle using m_visibleToInjectedBundle.
3482         * UIProcess/WebPageProxy.h: Added m_visibleToInjectedBundle.
3483         (WebKit::WebPageProxy::visibleToInjectedBundle): Added. Return m_visibleToInjectedBundle.
3484         (WebKit::WebPageProxy::setVisibleToInjectedBundle): Added. Set m_visibleToInjectedBundle.
3485         * UIProcess/win/WebView.cpp:
3486         (WebKit::WebView::WebView): Added InjectedBundleVisibility parameter and calls
3487         WebPageProxy::setVisibleToInjectedBundle.
3488         * UIProcess/win/WebView.h: Added InjectedBundleVisibility enum.
3489         (WebKit::WebView::create): Added InjectedBundleVisibility parameter.
3490         * WebProcess/WebPage/WebPage.cpp:
3491         (WebKit::WebPage::create): Checks visibleToInjectedBundle before talking to the injected bundle.
3492         (WebKit::WebPage::WebPage): Initialize m_isVisibleToInjectedBundle from the creation parameters.
3493         (WebKit::WebPage::close): Checks m_isVisibleToInjectedBundle before talking to the injected bundle.
3494         * WebProcess/WebPage/WebPage.h: Added m_isVisibleToInjectedBundle.
3495
3496 2010-11-17  Andras Becsi  <abecsi@webkit.org>
3497
3498         Unreviewed buildfix.
3499
3500         [Qt] D'oh! I screwed up the dependencies.
3501
3502         * DerivedSources.pro:
3503
3504 2010-11-17  Kenneth Rohde Christiansen  <kenneth@webkit.org>
3505
3506         Reviewed by Andreas Kling.
3507
3508         [WK2] Set paintsEntireContents for "resizes to contents" mode
3509
3510         Only relevant for the tiled backing store.
3511
3512         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3513         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3514         * WebProcess/WebPage/WebPage.cpp:
3515         (WebKit::WebPage::setResizesToContentsUsingLayoutSize):
3516
3517 2010-11-17  Andras Becsi  <abecsi@webkit.org>
3518
3519         Reviewed by Andreas Kling.
3520
3521         [Qt][WK2] Make it possible to set custom user agent strings in MiniBrowser
3522         https://bugs.webkit.org/show_bug.cgi?id=49627
3523
3524         Copy the MiniBrowser.qrc and QtTestBrowser's useragentlist.txt file
3525         to the build directory of MiniBrowser because it has to be in a
3526         subdirectory of the resource file.
3527         Add a method to QWKPage to retrieve the custom user agent string.
3528
3529         * DerivedSources.pro:
3530         * UIProcess/API/qt/qwkpage.cpp:
3531         (QWKPage::customUserAgent):
3532         * UIProcess/API/qt/qwkpage.h:
3533
3534 2010-11-17  Simon Fraser  <simon.fraser@apple.com>
3535
3536         Reviewed by Adam Roben.
3537
3538         https://bugs.webkit.org/show_bug.cgi?id=45567
3539         Add stubbed-out layer-backed drawing area for Windows.
3540
3541         Add implementations of LayerBackedDrawingArea and
3542         LayerBackedDrawingAreaProxy for Windows, and add them
3543         to the vcproj.
3544
3545         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
3546         * UIProcess/win/LayerBackedDrawingAreaProxyWin.cpp: Added.
3547         (WebKit::LayerBackedDrawingAreaProxy::page):
3548         (WebKit::LayerBackedDrawingAreaProxy::platformSetSize):
3549         (WebKit::LayerBackedDrawingAreaProxy::attachCompositingContext):
3550         (WebKit::LayerBackedDrawingAreaProxy::detachCompositingContext):
3551         (WebKit::LayerBackedDrawingAreaProxy::paint):
3552         * UIProcess/win/WebView.cpp:
3553         (WebKit::WebView::pageDidEnterAcceleratedCompositing):
3554         (WebKit::WebView::pageDidLeaveAcceleratedCompositing):
3555         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary):
3556         * UIProcess/win/WebView.h:
3557         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
3558         * WebProcess/WebPage/win/LayerBackedDrawingAreaWin.cpp: Added.
3559         (WebKit::LayerBackedDrawingArea::platformInit):
3560         (WebKit::LayerBackedDrawingArea::platformClear):
3561         (WebKit::LayerBackedDrawingArea::attachCompositingContext):
3562         (WebKit::LayerBackedDrawingArea::detachCompositingContext):
3563         (WebKit::LayerBackedDrawingArea::setRootCompositingLayer):
3564         (WebKit::LayerBackedDrawingArea::scheduleCompositingLayerSync):
3565         (WebKit::LayerBackedDrawingArea::syncCompositingLayers):
3566         * win/WebKit2.vcproj:
3567
3568 2010-11-17  Benjamin Poulain  <benjamin.poulain@nokia.com>
3569
3570         Reviewed by Kenneth Rohde Christiansen.
3571
3572         [Qt] [WK2] The focus switching does not seems to work with QGraphicsWKView
3573         https://bugs.webkit.org/show_bug.cgi?id=49545
3574
3575         Implement focus switching with Tab. This is now done asynchronously,
3576         waiting for webkit to call takeFocus() and switching the widget.
3577
3578         Since the focus can change between the Tab press and the callback,
3579         QGraphicsWKView::focusNextPrevChildCallback() make sure the view still has
3580         focus before passing it to the next widget.
3581
3582         * UIProcess/API/qt/qgraphicswkview.cpp:
3583         (QGraphicsWKView::QGraphicsWKView):
3584         (QGraphicsWKView::focusNextPrevChildCallback):
3585         (QGraphicsWKView::focusNextPrevChild):
3586         * UIProcess/API/qt/qgraphicswkview.h:
3587         * UIProcess/API/qt/qwkpage.cpp:
3588         (QWKPagePrivate::takeFocus):
3589         * UIProcess/API/qt/qwkpage.h:
3590         * UIProcess/API/qt/qwkpage_p.h:
3591
3592 2010-11-17  Andreas Kling  <kling@webkit.org>
3593
3594         Reviewed by Kenneth Rohde Christiansen.
3595
3596         Don't prohibit scrolling in tiled backing store mode.
3597
3598         We delegate scrolling instead.
3599
3600         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3601         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3602
3603 2010-11-17  Simon Hausmann  <simon.hausmann@nokia.com>
3604
3605         Reviewed by Kenneth Christiansen.
3606
3607         [Qt] Improve painting performance on 16-bit displays
3608
3609         When the default pixmap depth is 16-bit, then use RGB16 instead of
3610         RGB32 for the chunks, to avoid unnecessary conversions and reduce
3611         chunk size. The conversions happen as images as QPixmaps have 16-bit
3612         depth and the tiles on the ui process are also backed by QPixmaps.
3613
3614         * Shared/qt/UpdateChunk.cpp:
3615         (WebKit::UpdateChunk::size):
3616         (WebKit::UpdateChunk::createImage):
3617         * Shared/qt/UpdateChunk.h:
3618
3619 2010-11-16  Sam Weinig  <sam@webkit.org>
3620
3621         Reviewed by Adam Roben.
3622
3623         WebKit2: Support enabling site-specific quirks
3624         <rdar://problem/8451371>
3625         https://bugs.webkit.org/show_bug.cgi?id=46076
3626
3627         * Shared/WebPreferencesStore.cpp:
3628         (WebKit::WebPreferencesStore::WebPreferencesStore):
3629         (WebKit::WebPreferencesStore::encode):
3630         (WebKit::WebPreferencesStore::decode):
3631         * Shared/WebPreferencesStore.h:
3632         Add needsSiteSpecificQuirks;
3633
3634         * UIProcess/API/C/WKAPICast.h:
3635         (WebKit::toFontSmoothingLevel):
3636         (WebKit::toAPI):
3637         Move FontSmoothing conversion functions here.
3638
3639         * UIProcess/API/C/WKPreferences.cpp:
3640         (WKPreferencesSetFontSmoothingLevel):
3641         (WKPreferencesGetFontSmoothingLevel):
3642         (WKPreferencesSetAcceleratedCompositingEnabled):
3643         (WKPreferencesGetAcceleratedCompositingEnabled):
3644         (WKPreferencesSetCompositingBordersVisible):
3645         (WKPreferencesGetCompositingBordersVisible):
3646         (WKPreferencesSetCompositingRepaintCountersVisible):
3647         (WKPreferencesGetCompositingRepaintCountersVisible):
3648         (WKPreferencesSetNeedsSiteSpecificQuirks):
3649         (WKPreferencesGetNeedsSiteSpecificQuirks):
3650         Add WKPreferencesSetNeedsSiteSpecificQuirks/WKPreferencesGetNeedsSiteSpecificQuirks
3651         and move implementations from WKPreferencesPrivate.cpp here.
3652
3653         * UIProcess/API/C/WKPreferencesPrivate.cpp: Removed.
3654
3655         * UIProcess/API/C/WKPreferencesPrivate.h:
3656         Add Add WKPreferencesSetNeedsSiteSpecificQuirks/WKPreferencesGetNeedsSiteSpecificQuirks.
3657
3658         * UIProcess/WebPreferences.cpp:
3659         (WebKit::WebPreferences::setNeedsSiteSpecificQuirks):
3660         (WebKit::WebPreferences::needsSiteSpecificQuirks):
3661         * UIProcess/WebPreferences.h:
3662         * WebProcess/WebPage/WebPage.cpp:
3663         (WebKit::WebPage::updatePreferences):
3664         Pipe through needsSiteSpecificQuirks.
3665
3666         * WebKit2.xcodeproj/project.pbxproj:
3667         * WebKit2.pro:
3668         * win/WebKit2.vcproj:
3669         Update for removed files.
3670
3671 2010-11-16  Adam Roben  <aroben@apple.com>
3672
3673         Fix horizontal scrolling via the mousewheel/trackpad on Windows
3674
3675         Reviewed by Mark Rowe.
3676
3677         * Shared/win/WebEventFactory.cpp: Fixed typo in the
3678         WM_VISTA_MOUSEHWHEEL constant.
3679
3680 2010-11-16  Steve Falkenburg  <sfalken@apple.com>
3681
3682         Reviewed by Adam Roben.
3683
3684         Disable LTCG for Windows Release builds. Add new Release_LTCG configuration.
3685         https://bugs.webkit.org/show_bug.cgi?id=49632
3686
3687         * win/WebKit2.make:
3688         * win/WebKit2.submit.sln:
3689         * win/WebKit2.vcproj:
3690         * win/WebKit2WebProcess.vcproj:
3691
3692 2010-11-16  Anders Carlsson  <andersca@apple.com>
3693
3694         Reviewed by Sam Weinig.
3695
3696         Handle converting a ResourceHandle to a download
3697         https://bugs.webkit.org/show_bug.cgi?id=49631
3698
3699         * WebProcess/Downloads/Download.h:
3700         Add startWithHandle.
3701
3702         * WebProcess/Downloads/DownloadManager.h:
3703         * WebProcess/Downloads/DownloadManager.cpp:
3704         (WebKit::DownloadManager::convertHandleToDownload):
3705         Create a new Download object and call startWithHandle on it.
3706
3707         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
3708         (WebKit::Download::startWithHandle):
3709         Add stub.
3710
3711         * WebProcess/Downloads/mac/DownloadMac.mm:
3712         (WebKit::Download::startWithHandle):
3713         Create an NSURLDownload object from passed in ResourceHandle.
3714
3715         * WebProcess/Downloads/qt/DownloadQt.cpp:
3716         (WebKit::Download::startWithHandle):
3717         Add stub.
3718
3719         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3720         (WebKit::WebFrameLoaderClient::download):
3721         Call WebFrame::convertHandleToDownload.
3722
3723         * WebProcess/WebPage/WebFrame.cpp:
3724         (WebKit::WebFrame::convertHandleToDownload):
3725         Call DownloadManager::convertHandleToDownload.
3726
3727 2010-11-16  Anders Carlsson  <andersca@apple.com>
3728
3729         Reviewed by John Sullivan.
3730
3731         Set the original URL for downloads
3732         https://bugs.webkit.org/show_bug.cgi?id=49628
3733
3734         * WebProcess/Downloads/DownloadManager.cpp:
3735         (WebKit::DownloadManager::startDownload):
3736         * WebProcess/Downloads/DownloadManager.h:
3737         startDownload now takes the originating web page.
3738
3739         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
3740         (WebKit::Download::start):
3741         start now takes the originating web page.
3742
3743         * WebProcess/Downloads/mac/DownloadMac.mm:
3744         (WebKit::originatingURL):
3745         (WebKit::setOriginalURLForDownload):
3746         Port code over from WebKit1 that sets the download URL.
3747
3748         (WebKit::Download::start):
3749         Call setOriginalURLForDownload.
3750
3751         * WebProcess/Downloads/qt/DownloadQt.cpp:
3752         (WebKit::Download::start):
3753         start now takes the originating web page.
3754
3755         * WebProcess/WebPage/WebFrame.cpp:
3756         (WebKit::WebFrame::startDownload):
3757         Pass the web page to DownloadManager::startDownload.
3758
3759 2010-11-16  Dave Hyatt  <hyatt@apple.com>
3760
3761         Reviewed by Dan Bernstein.
3762
3763         https://bugs.webkit.org/show_bug.cgi?id=11004
3764         
3765         font-size:0 is ignored.  Remove the minimum font size of 1 in CSSStyleSelector.
3766         Change the pref value for minimum font size from 1 to 0.  Make sure to never use the NSFont's size,
3767         since it doesn't honor a size of 0.  Instead pass the size in to the FontPlatformData(NSFont*) version
3768         of the constructor rather than using [NSFont pointSize].
3769
3770         https://bugs.webkit.org/show_bug.cgi?id=49582
3771         
3772         Negative leading is not handled correctly.  There are two bugs here.  The first is that
3773         maxAscent and maxDescent can be negative, so we need a notion of whether or not we have
3774         set them before so that we can allow them to be < 0.
3775         
3776         The second issue is that we should understand where fonts will end up relative to
3777         our baseline (excluding line height), and only allow those boxes to impact ascent and
3778         descent if the actual font box (without factoring in line height) is above or below the
3779         root line box baseline.
3780
3781         Added fast/css/negative-leading.html
3782         
3783         These two bug fixes have to land together to keep the Acid 3 test rendering correctly.
3784
3785         * Shared/WebPreferencesStore.cpp:
3786         (WebKit::WebPreferencesStore::WebPreferencesStore):
3787
3788 2010-11-16  Anders Carlsson  <andersca@apple.com>
3789
3790         Fix clang++ build.
3791
3792         * Scripts/webkit2/messages.py:
3793         * WebProcess/WebPage/WebInspector.h:
3794
3795 2010-11-16  Anders Carlsson  <andersca@apple.com>
3796
3797         Reviewed by Sam Weinig.
3798
3799         Add WKPageCanShowMIMEType
3800         https://bugs.webkit.org/show_bug.cgi?id=49612
3801
3802         * UIProcess/API/C/WKPage.cpp:
3803         (WKPageCanShowMIMEType):
3804         * UIProcess/API/C/WKPage.h:
3805         * UIProcess/WebPageProxy.cpp:
3806         (WebKit::WebPageProxy::canShowMIMEType):
3807         * UIProcess/WebPageProxy.h:
3808
3809 2010-11-16  Anders Carlsson  <andersca@apple.com>
3810
3811         Reviewed by Sam Weinig.
3812
3813         Make WebPageProxy::decidePolicyForMIMEType a tad synchronous
3814         https://bugs.webkit.org/show_bug.cgi?id=49605
3815
3816         Change the DecidePolicyForMIMEType message to be synchronous, and if the policy listener is
3817         invoked from within the decidePolicyForMIMEType callback return the policy information as out
3818         parameters. This is needed in order to convert a loading connection to a download.
3819
3820         * Platform/CoreIPC/HandleMessage.h:
3821         (CoreIPC::callMemberFunction):
3822         * UIProcess/WebPageProxy.cpp:
3823         (WebKit::WebPageProxy::WebPageProxy):
3824         (WebKit::WebPageProxy::receivedPolicyDecision):
3825         (WebKit::WebPageProxy::decidePolicyForMIMEType):
3826         * UIProcess/WebPageProxy.h:
3827         * UIProcess/WebPageProxy.messages.in:
3828         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3829         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
3830
3831 2010-11-16  Kenneth Rohde Christiansen  <kenneth@webkit.org>, Zalan Bujtas  <zbujtas@gmail.com>
3832
3833         Reviewed by Andreas Kling.
3834
3835         [WK2][Qt] Add API for finding a zoomable area for a given point
3836
3837         This is useful for implementing e.g "double tap zoom"
3838
3839         Only enabled for Qt.
3840
3841         * UIProcess/API/qt/qwkpage.cpp:
3842         (QWKPage::findZoomableAreaForPoint):
3843         (QWKPagePrivate::didFindZoomableArea):
3844         * UIProcess/API/qt/qwkpage.h:
3845         * UIProcess/API/qt/qwkpage_p.h:
3846         * UIProcess/PageClient.h:
3847         * UIProcess/WebPageProxy.cpp:
3848         (WebKit::WebPageProxy::didFindZoomableArea):
3849         (WebKit::WebPageProxy::findZoomableAreaForPoint):
3850         * UIProcess/WebPageProxy.h:
3851         * UIProcess/WebPageProxy.messages.in:
3852         * WebProcess/WebPage/WebPage.cpp:
3853         (WebKit::WebPage::findZoomableAreaForPoint):
3854         * WebProcess/WebPage/WebPage.h:
3855         * WebProcess/WebPage/WebPage.messages.in:
3856
3857 2010-11-16  Andreas Kling  <kling@webkit.org>
3858
3859         Rubber-stamped by Simon Hausmann.
3860
3861         Revert !ENABLE(INSPECTOR) fix- we don't need it right now,
3862         and it was less maintainable than I had though.
3863
3864         * Shared/API/c/WKSharedAPICast.h:
3865         (WebKit::toAPI):
3866         (WebKit::toImpl):
3867         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3868         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
3869         * WebProcess/WebPage/WebInspector.cpp:
3870
3871 2010-11-16  Andreas Kling  <kling@webkit.org>
3872
3873         Reviewed by Simon Hausmann.
3874
3875         Fix compilation with !ENABLE(INSPECTOR)
3876
3877         * Shared/API/c/WKSharedAPICast.h:
3878         (WebKit::toAPI):
3879         (WebKit::toImpl):
3880         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3881         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
3882         * WebProcess/WebPage/WebInspector.cpp:
3883
3884 2010-11-16  Andras Becsi  <abecsi@webkit.org>
3885
3886         Reviewed by Andreas Kling.
3887
3888         [Qt] Use SIGINT instead of SIGKILL to let the web process clean up after itself.
3889
3890         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
3891         (WebKit::QtWebProcess::setupChildProcess):
3892
3893 2010-11-16  Kenneth Rohde Christiansen  <kenneth@webkit.org>
3894
3895         Reviewed by Andreas Kling.
3896
3897         [WK2][Qt] Expose resizes-to-contents mode in WebKit2
3898
3899         Only available with ENABLE(TILED_BACKING_STORE)
3900
3901         Based on a patch by Antti Koivisto.
3902
3903         * UIProcess/API/qt/qwkpage.cpp:
3904         (QWKPage::setResizesToContentsUsingLayoutSize):
3905         * UIProcess/API/qt/qwkpage.h:
3906         * UIProcess/WebPageProxy.cpp:
3907         (WebKit::WebPageProxy::setResizesToContentsUsingLayoutSize):
3908         * UIProcess/WebPageProxy.h:
3909         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3910         (WebKit::WebChromeClient::contentsSizeChanged):
3911         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3912         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3913         * WebProcess/WebPage/WebPage.cpp:
3914         (WebKit::WebPage::setSize):
3915         (WebKit::WebPage::setResizesToContentsUsingLayoutSize):
3916         (WebKit::WebPage::resizeToContentsIfNeeded):
3917         * WebProcess/WebPage/WebPage.h:
3918         (WebKit::WebPage::resizesToContentsEnabled):
3919         (WebKit::WebPage::resizesToContentsLayoutSize):
3920         * WebProcess/WebPage/WebPage.messages.in:
3921
3922 2010-11-16  Andreas Kling  <kling@webkit.org>
3923
3924         Reviewed by Kenneth Rohde Christiansen.
3925
3926         [Qt][WK2] Get proxy settings from environment (http[s]_proxy)
3927
3928         If http_proxy and/or https_proxy are set in the environment,
3929         pass those in to QNetworkAccessManager.
3930
3931         * WebProcess/qt/WebProcessMainQt.cpp:
3932         (WebKit::EnvHttpProxyFactory::EnvHttpProxyFactory):
3933         (WebKit::EnvHttpProxyFactory::initializeFromEnvironment):
3934         (WebKit::EnvHttpProxyFactory::queryProxy):
3935         (WebKit::initializeProxy):
3936         (WebKit::WebProcessMainQt):
3937
3938 2010-11-16  Andreas Kling  <kling@webkit.org>
3939
3940         Reviewed by Kenneth Rohde Christiansen.
3941
3942         [Qt][WK2] Emit windowCloseRequested signal on window.close()
3943
3944         Original patch by Zalan Bujtas.
3945
3946         * UIProcess/API/qt/ClientImpl.cpp:
3947         (qt_wk_close):
3948         * UIProcess/API/qt/qwkpage.h:
3949
3950 2010-11-15  Andreas Kling  <kling@webkit.org>
3951
3952         Reviewed by Kenneth Rohde Christiansen.
3953
3954         [Qt] Kill the web process if the UI process dies
3955
3956         Connect UI (parent) process death signal to SIGKILL of the web
3957         process (child). This ensures that there's no stale web processes
3958         after the UI process has crashed.
3959
3960         Original patch by Kimmo Kinnunen.
3961
3962         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
3963         (WebKit::QtWebProcess::QtWebProcess):
3964         (WebKit::QtWebProcess::setupChildProcess):
3965         (WebKit::ProcessLauncherHelper::launch):
3966
3967 2010-11-16  Simon Hausmann  <simon.hausmann@nokia.com>
3968
3969         Rubber-stamped by Andreas Kling.
3970
3971         [Qt] Trivial build fix for building WebKit2 inside Qt Creator
3972
3973         Similar to WebCore.pro, define a fallback for OUTPUT_DIR.
3974
3975         * WebKit2.pro:
3976
3977 2010-11-15  Andreas Kling  <kling@webkit.org>
3978
3979         Reviewed by Tor Arne Vestbø.
3980
3981         [Qt] Make sure qwkpage.h and qwkpreferences.h are copied into includes/WebKit2
3982
3983         * UIProcess/API/qt/WKView.h:
3984
3985 2010-11-15  Andreas Kling  <kling@webkit.org>
3986
3987         Reviewed by Tor Arne Vestbø.
3988
3989         [Qt] Use $${PYTHON} rather than "python" to execute Python scripts
3990
3991         Fixes building with the old Python that currently ships with Scratchbox.
3992
3993         * DerivedSources.pro:
3994
3995 2010-11-15  Brady Eidson  <beidson@apple.com>
3996
3997         Reviewed by a better attempt at a Windows build fix.
3998
3999         * win/WebKit2Generated.make:
4000
4001 2010-11-15  Brady Eidson  <beidson@apple.com>
4002
4003         Reviewed by my attempt to fix the Windows build
4004
4005         * win/WebKit2Generated.make: Add new API headers here.
4006
4007 2010-11-15  Brady Eidson  <beidson@apple.com>
4008
4009         Reviewed by Sam Weinig.
4010
4011         Finish off <rdar://problem/8613727> and https://bugs.webkit.org/show_bug.cgi?id=48720
4012         Customizable context menu support in WebKit2.
4013
4014         - Adds an API-level WKContextMenuItem.
4015         - Round trips through both the InjectedBundle client and the new PageContextMenuClient before
4016           actually displaying the menu.
4017
4018         * WebKit2.pro:
4019         * WebKit2.xcodeproj/project.pbxproj:
4020         * win/WebKit2.vcproj:
4021
4022         * Shared/API/c/WKBase.h:
4023         * Shared/API/c/WKContextMenuItem.cpp: Added.
4024         (WKContextMenuItemGetTypeID):
4025         (WKContextMenuItemCreateAsAction):
4026         (WKContextMenuItemCreateAsCheckableAction):
4027         (WKContextMenuItemCreateAsSubmenu):
4028         (WKContextMenuItemSeparatorItem):
4029         (WKContextMenuItemGetTag):
4030         (WKContextMenuItemGetType):
4031         (WKContextMenuItemCopyTitle):
4032         (WKContextMenuItemGetEnabled):
4033         (WKContextMenuItemGetChecked):
4034         (WKContextMenuCopySubmenuItems):
4035         * Shared/API/c/WKContextMenuItem.h: Added.
4036         * Shared/API/c/WKContextMenuItemTypes.h: Added.
4037
4038         * Shared/API/c/WKSharedAPICast.h:
4039         (WebKit::toAPI):
4040         (WebKit::toImpl):
4041
4042         * Shared/WebContextMenuItem.cpp:
4043         (WebKit::WebContextMenuItem::create):
4044         (WebKit::WebContextMenuItem::separatorItem):
4045         (WebKit::WebContextMenuItem::submenuItemsAsImmutableArray):
4046         * Shared/WebContextMenuItem.h:
4047
4048         * UIProcess/API/C/WKPage.cpp:
4049         (WKPageSetPageContextMenuClient):
4050         (WKPageSetPageFindClient):
4051         (WKPageSetPageLoaderClient):
4052         (WKPageSetPagePolicyClient):
4053         (WKPageSetPageUIClient):
4054         * UIProcess/API/C/WKPage.h:
4055
4056         * UIProcess/WebPageContextMenuClient.cpp: Added.
4057         (WebKit::WebPageContextMenuClient::getContextMenuFromProposedMenu):
4058         * UIProcess/WebPageContextMenuClient.h: Added.
4059
4060         * UIProcess/WebPageProxy.cpp:
4061         (WebKit::WebPageProxy::initializeContextMenuClient):
4062         (WebKit::WebPageProxy::showContextMenu):
4063         * UIProcess/WebPageProxy.h:
4064         * UIProcess/WebPageProxy.messages.in:
4065
4066         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
4067         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
4068         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
4069         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
4070
4071         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
4072         (WebKit::WebContextMenuClient::getCustomMenuFromDefaultItems):
4073         * WebProcess/WebPage/WebContextMenu.cpp:
4074         (WebKit::WebContextMenu::show):
4075
4076 2010-11-15  Anders Carlsson  <andersca@apple.com>
4077
4078         Reviewed by Sam Weinig.
4079
4080         Add shouldDecodeSourceDataOfMIMEType WKContextDownloadClient callback
4081         https://bugs.webkit.org/show_bug.cgi?id=49558
4082
4083         * UIProcess/API/C/WKContext.h:
4084         Add shouldDecodeSourceDataOfMIMEType callback.
4085
4086         * UIProcess/Downloads/DownloadProxy.cpp:
4087         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType):
4088         Call WebDownloadClient::shouldDecodeSourceDataOfMIMEType.
4089
4090         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
4091         Add allowOverwrite out parameter.
4092
4093         * UIProcess/Downloads/DownloadProxy.h:
4094         * UIProcess/Downloads/DownloadProxy.messages.in:
4095         Add ShouldDecodeSourceDataOfMIMEType message.
4096
4097         * UIProcess/WebDownloadClient.cpp:
4098         (WebKit::WebDownloadClient::shouldDecodeSourceDataOfMIMEType):
4099         Call the WKContextDownloadClient.
4100
4101         (WebKit::WebDownloadClient::decideDestinationWithSuggestedFilename):
4102         Add allowOverwrite out parameter.
4103
4104         * UIProcess/WebDownloadClient.h:
4105         * WebProcess/Downloads/Download.cpp:
4106         (WebKit::Download::shouldDecodeSourceDataOfMIMEType):
4107         Send the ShouldDecodeSourceDataOfMIMEType message.
4108
4109         (WebKit::Download::decideDestinationWithSuggestedFilename):
4110         Add allowOverwrite reply parameter.
4111
4112         * WebProcess/Downloads/mac/DownloadMac.mm:
4113         (-[WKDownloadAsDelegate download:shouldDecodeSourceDataOfMIMEType:]):
4114         Call Download::shouldDecodeSourceDataOfMIMEType.
4115
4116         (-[WKDownloadAsDelegate download:decideDestinationWithSuggestedFilename:]):
4117         Add allowOverwrite parameter.
4118
4119 2010-11-15  Anders Carlsson  <andersca@apple.com>
4120
4121         Reviewed by Sam Weinig.
4122
4123         Add decideDestinationWithSuggestedFilename WKContextDownloadClient callback
4124         https://bugs.webkit.org/show_bug.cgi?id=49554
4125
4126         * Platform/CoreIPC/MessageSender.h:
4127         (CoreIPC::MessageSender::sendSync):
4128         Add sendSync capabilities to Messagesender.
4129         
4130         * UIProcess/API/C/WKContext.h:
4131         Add decideDestinationWithSuggestedFilename callback.
4132
4133         * UIProcess/Downloads/DownloadProxy.cpp:
4134         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
4135         Call WebDownloadClient::decideDestinationWithSuggestedFilename.
4136
4137         * UIProcess/Downloads/DownloadProxy.messages.in:
4138         Add DecideDestinationWithSuggestedFilename.
4139
4140         * UIProcess/WebContext.cpp:
4141         (WebKit::WebContext::didReceiveSyncMessage):
4142         Process MessageClassDownloadProxy messages.
4143
4144         * UIProcess/WebDownloadClient.cpp:
4145         (WebKit::WebDownloadClient::decideDestinationWithSuggestedFilename):
4146         Ask the WKContextDownloadClient for the destination.
4147
4148         * UIProcess/WebProcessProxy.cpp:
4149         (WebKit::WebProcessProxy::didReceiveSyncMessage):
4150         MessageClassDownloadProxy messages should go to the WebContext.
4151
4152         * WebProcess/Downloads/Download.cpp:
4153         (WebKit::Download::decideDestinationWithSuggestedFilename):
4154         Send the DecideDestinationWithSuggestedFilename message.
4155
4156         * WebProcess/Downloads/Download.h:
4157         * WebProcess/Downloads/mac/DownloadMac.mm:
4158         (-[WKDownloadAsDelegate download:decideDestinationWithSuggestedFilename:]):
4159         call Download::decideDestinationWithSuggestedFilename and set the destination.
4160
4161 2010-11-15  Andreas Kling  <kling@webkit.org>
4162
4163         Reviewed by Kenneth Rohde Christiansen.
4164
4165         [WK2][Qt] Add "page snapshot" functionality to tiled backing store
4166
4167         Original patch by Antti Koivisto.
4168
4169         Add a way to take a snapshot of a specific part of the page, at a specific scale.
4170         Only implemented for the tiled drawing area.
4171
4172         * Shared/CoreIPCSupport/DrawingAreaMessageKinds.h:
4173         New message: TakeSnapshot.
4174
4175         * Shared/CoreIPCSupport/DrawingAreaProxyMessageKinds.h:
4176         New message: SnapshotTaken.
4177
4178         * UIProcess/API/qt/qgraphicswkview.h:
4179         * UIProcess/API/qt/qgraphicswkview.cpp:
4180         (QGraphicsWKView::takeSnapshot):
4181         Expose the snapshot functionality.
4182
4183         * UIProcess/TiledDrawingAreaProxy.cpp:
4184         (WebKit::TiledDrawingAreaProxy::didReceiveMessage):
4185         (WebKit::TiledDrawingAreaProxy::takeSnapshot):
4186         * UIProcess/TiledDrawingAreaProxy.h:
4187         * UIProcess/qt/TiledDrawingAreaProxyQt.cpp:
4188         (WebKit::TiledDrawingAreaProxy::snapshotTaken):
4189         * WebProcess/WebPage/TiledDrawingArea.cpp:
4190         (WebKit::TiledDrawingArea::didReceiveMessage):
4191
4192 2010-11-15  Andreas Kling  <andreas.kling@nokia.com>
4193
4194         Reviewed by Kenneth Rohde Christiansen.
4195
4196         [WK2][Qt] WebKit2 implementation of tiled backing store
4197         https://bugs.webkit.org/show_bug.cgi?id=49526
4198
4199         Basic opt-in tiling implementation for WebKit2/Qt.
4200
4201         Original patch by Antti Koivisto.
4202
4203         * Shared/CoreIPCSupport/DrawingAreaMessageKinds.h:
4204         New messages: RequestTileUpdate and CancelTileUpdate.
4205
4206         * Shared/CoreIPCSupport/DrawingAreaProxyMessageKinds.h:
4207         New messages: Invalidate, TileUpdated, AllTileUpdatesProcessed.
4208
4209         * Shared/DrawingAreaBase.h:
4210         New area type: TiledDrawingAreaType.
4211
4212         * UIProcess/API/qt/qgraphicswkview.h:
4213         * UIProcess/API/qt/qgraphicswkview.cpp:
4214         (QGraphicsWKView::QGraphicsWKView):
4215         (QGraphicsWKView::setGeometry):
4216         (QGraphicsWKViewPrivate::QGraphicsWKViewPrivate):
4217         (QGraphicsWKView::prepareScaleChange):
4218         (QGraphicsWKView::commitScaleChange):
4219         (QGraphicsWKViewPrivate::onScaleChanged):
4220         (QGraphicsWKViewPrivate::commitScale):
4221         Support for tiled backing store.
4222
4223         * UIProcess/TiledDrawingAreaProxy.cpp: Added.
4224         (WebKit::TiledDrawingAreaProxy::create):
4225         (WebKit::TiledDrawingAreaProxy::TiledDrawingAreaProxy):
4226         (WebKit::TiledDrawingAreaProxy::~TiledDrawingAreaProxy):
4227         (WebKit::TiledDrawingAreaProxy::setSize):
4228         (WebKit::TiledDrawingAreaProxy::setPageIsVisible):
4229         (WebKit::TiledDrawingAreaProxy::didSetSize):
4230         (WebKit::TiledDrawingAreaProxy::didReceiveMessage):
4231         (WebKit::TiledDrawingAreaProxy::didReceiveSyncMessage):
4232         (WebKit::TiledDrawingAreaProxy::requestTileUpdate):
4233         (WebKit::TiledDrawingAreaProxy::waitUntilUpdatesComplete):
4234         (WebKit::TiledDrawingAreaProxy::createTile):
4235         (WebKit::TiledDrawingAreaProxy::setTileSize):
4236         (WebKit::TiledDrawingAreaProxy::setTileCreationDelay):
4237         (WebKit::TiledDrawingAreaProxy::setKeepAndCoverAreaMultipliers):
4238         (WebKit::TiledDrawingAreaProxy::invalidate):
4239         (WebKit::TiledDrawingAreaProxy::updateTileBuffers):
4240         (WebKit::TiledDrawingAreaProxy::tileBufferUpdateComplete):
4241         (WebKit::TiledDrawingAreaProxy::paint):
4242         (WebKit::TiledDrawingAreaProxy::adjustVisibleRect):
4243         (WebKit::TiledDrawingAreaProxy::setContentsScale):
4244         (WebKit::TiledDrawingAreaProxy::removeAllTiles):
4245         (WebKit::TiledDrawingAreaProxy::tileDistance):
4246         (WebKit::TiledDrawingAreaProxy::calculateKeepRect):
4247         (WebKit::TiledDrawingAreaProxy::calculateCoverRect):
4248         (WebKit::TiledDrawingAreaProxy::createTiles):
4249         (WebKit::TiledDrawingAreaProxy::resizeEdgeTiles):
4250         (WebKit::TiledDrawingAreaProxy::dropTilesOutsideRect):
4251         (WebKit::TiledDrawingAreaProxy::tileAt):
4252         (WebKit::TiledDrawingAreaProxy::setTile):
4253         (WebKit::TiledDrawingAreaProxy::removeTile):
4254         (WebKit::TiledDrawingAreaProxy::mapToContents):
4255         (WebKit::TiledDrawingAreaProxy::mapFromContents):
4256         (WebKit::TiledDrawingAreaProxy::contentsRect):
4257         (WebKit::TiledDrawingAreaProxy::tileRectForCoordinate):
4258         (WebKit::TiledDrawingAreaProxy::tileCoordinateForPoint):
4259         (WebKit::TiledDrawingAreaProxy::startTileBufferUpdateTimer):
4260         (WebKit::TiledDrawingAreaProxy::tileBufferUpdateTimerFired):
4261         (WebKit::TiledDrawingAreaProxy::startTileCreationTimer):
4262         (WebKit::TiledDrawingAreaProxy::tileCreationTimerFired):
4263         (WebKit::TiledDrawingAreaProxy::hasPendingUpdates):
4264         * UIProcess/TiledDrawingAreaProxy.h: Added.
4265         (WebKit::TiledDrawingAreaProxy::contentsScale):
4266         (WebKit::TiledDrawingAreaProxy::attachCompositingContext):
4267         (WebKit::TiledDrawingAreaProxy::detachCompositingContext):
4268         (WebKit::TiledDrawingAreaProxy::tileSize):
4269         (WebKit::TiledDrawingAreaProxy::tileCreationDelay):
4270         (WebKit::TiledDrawingAreaProxy::getKeepAndCoverAreaMultipliers):
4271         * UIProcess/TiledDrawingAreaTile.h: Added.
4272         (WebKit::TiledDrawingAreaTile::create):
4273         (WebKit::TiledDrawingAreaTile::hasBackBufferUpdatePending):
4274         (WebKit::TiledDrawingAreaTile::coordinate):
4275         (WebKit::TiledDrawingAreaTile::rect):
4276         (WebKit::TiledDrawingAreaTile::ID):
4277         * WebProcess/WebPage/DrawingArea.cpp:
4278         (WebKit::DrawingArea::create):
4279         * WebProcess/WebPage/TiledDrawingArea.cpp: Added.
4280         (WebKit::TiledDrawingArea::TiledDrawingArea):
4281         (WebKit::TiledDrawingArea::~TiledDrawingArea):
4282         (WebKit::TiledDrawingArea::invalidateWindow):
4283         (WebKit::TiledDrawingArea::invalidateContentsAndWindow):
4284         (WebKit::TiledDrawingArea::invalidateContentsForSlowScroll):
4285         (WebKit::TiledDrawingArea::scroll):
4286         (WebKit::TiledDrawingArea::setNeedsDisplay):
4287         (WebKit::TiledDrawingArea::display):
4288         (WebKit::TiledDrawingArea::scheduleDisplay):
4289         (WebKit::TiledDrawingArea::setSize):
4290         (WebKit::TiledDrawingArea::suspendPainting):
4291         (WebKit::TiledDrawingArea::resumePainting):
4292         (WebKit::TiledDrawingArea::didUpdate):
4293         (WebKit::TiledDrawingArea::updateTile):
4294         (WebKit::TiledDrawingArea::tileUpdateTimerFired):
4295         (WebKit::TiledDrawingArea::didReceiveMessage):
4296         * WebProcess/WebPage/TiledDrawingArea.h: Added.
4297         (WebKit::TiledDrawingArea::attachCompositingContext):
4298         (WebKit::TiledDrawingArea::detachCompositingContext):
4299         (WebKit::TiledDrawingArea::setRootCompositingLayer):
4300         (WebKit::TiledDrawingArea::scheduleCompositingLayerSync):
4301         (WebKit::TiledDrawingArea::syncCompositingLayers):
4302         * WebProcess/WebPage/qt/TiledDrawingAreaQt.cpp: Added.
4303         (WebKit::TiledDrawingArea::paintIntoUpdateChunk):
4304         * WebKit2.pro:
4305         * UIProcess/qt/TiledDrawingAreaTileQt.cpp: Added.
4306         (WebKit::checkeredPixmap):
4307         (WebKit::TiledDrawingAreaTile::TiledDrawingAreaTile):
4308         (WebKit::TiledDrawingAreaTile::~TiledDrawingAreaTile):
4309         (WebKit::TiledDrawingAreaTile::isDirty):
4310         (WebKit::TiledDrawingAreaTile::isReadyToPaint):
4311         (WebKit::TiledDrawingAreaTile::hasReadyBackBuffer):
4312         (WebKit::TiledDrawingAreaTile::invalidate):
4313         (WebKit::TiledDrawingAreaTile::resize):
4314         (WebKit::TiledDrawingAreaTile::swapBackBufferToFront):
4315         (WebKit::TiledDrawingAreaTile::paint):
4316         (WebKit::TiledDrawingAreaTile::paintCheckerPattern):
4317         (WebKit::TiledDrawingAreaTile::updateFromChunk):
4318         (WebKit::TiledDrawingAreaTile::updateBackBuffer):
4319         * UIProcess/qt/TiledDrawingAreaProxyQt.cpp: Added.
4320         (WebKit::TiledDrawingAreaProxy::updateWebView):
4321         (WebKit::TiledDrawingAreaProxy::webViewVisibleRect):
4322         (WebKit::TiledDrawingAreaProxy::page):
4323
4324 2010-11-12  Benjamin Poulain  <benjamin.poulain@nokia.com>
4325
4326         Reviewed by Andreas Kling.
4327
4328         [Qt] Need to implement WebKit::pluginWillHandleLoadError for WebKit2
4329         https://bugs.webkit.org/show_bug.cgi?id=48764
4330
4331         Add the missing error to Qt support.
4332
4333         * WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp:
4334         (WebKit::pluginWillHandleLoadError):
4335
4336 2010-11-12  John Sullivan  <sullivan@apple.com>
4337
4338         Reviewed by Anders Carlsson.
4339
4340         Fixed Target for WKBundlePageOverlay.cpp.
4341
4342         * WebKit2.xcodeproj/project.pbxproj:
4343         Changed Target for WKBundlePageOverlay.cpp from WebProcess to WebKit2.
4344
4345 2010-11-12  Anders Carlsson  <andersca@apple.com>
4346
4347         Reviewed by John Sullivan.
4348
4349         Need a way that WKBundlePageOverlayRef clients can make sure they only uninstall the overlay they installed
4350         https://bugs.webkit.org/show_bug.cgi?id=49461
4351         <rdar://problem/8662760>
4352
4353         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
4354         (WKBundlePageUninstallPageOverlay):
4355         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
4356         * WebProcess/WebPage/FindController.cpp:
4357         (WebKit::FindController::findString):
4358         (WebKit::FindController::hideFindUI):
4359         * WebProcess/WebPage/WebPage.cpp:
4360         (WebKit::WebPage::uninstallPageOverlay):
4361         * WebProcess/WebPage/WebPage.h:
4362
4363 2010-11-12  Anders Carlsson  <andersca@apple.com>
4364
4365         Reviewed by Sam Weinig.
4366
4367         Allow MessageSender to override sendMessage
4368         https://bugs.webkit.org/show_bug.cgi?id=49457
4369
4370         Change MessageSender::send to encode the message and then call sendMessage.
4371         This allows for clients to override sendMessage, something which WebProcessProxy
4372         will be able to take advantage of.
4373
4374         * Platform/CoreIPC/MessageSender.h:
4375         (CoreIPC::MessageSender::send):
4376         (CoreIPC::MessageSender::sendMessage):
4377
4378 2010-11-12  Anders Carlsson  <andersca@apple.com>
4379
4380         Reviewed by Sam Weinig.
4381
4382         CoreIPC cleanup
4383         https://bugs.webkit.org/show_bug.cgi?id=49455
4384
4385         Add a static create function to ArgumentEncoder. 
4386         Factor sync message argument encoder creation out into a new function,
4387         createSyncMessageArgumentEncoder.
4388         
4389         * Platform/CoreIPC/ArgumentEncoder.cpp:
4390         (CoreIPC::ArgumentEncoder::create):
4391         * Platform/CoreIPC/ArgumentEncoder.h:
4392         * Platform/CoreIPC/Connection.cpp:
4393         (CoreIPC::Connection::createSyncMessageArgumentEncoder):
4394         (CoreIPC::Connection::dispatchSyncMessage):
4395         * Platform/CoreIPC/Connection.h:
4396         (CoreIPC::Connection::send):
4397         (CoreIPC::Connection::sendSync):
4398         * UIProcess/WebProcessProxy.h:
4399         (WebKit::WebProcessProxy::send):
4400
4401 2010-11-12  Sam Weinig  <sam@webkit.org>
4402
4403         Reviewed by Anders Carlsson.
4404
4405         ASSERTION when converting some WKStringRefs returned from willSubmitForm to CFStringRef
4406         <rdar://problem/8662180>
4407         https://bugs.webkit.org/show_bug.cgi?id=49454
4408
4409         Enforce the invariant that a WebString never contains a null WTF::String at a
4410         lower level, in the WebString constructor, instead of relying on the callers of
4411         WebString::create to do it.
4412
4413         * Shared/API/c/WKSharedAPICast.h:
4414         (WebKit::toAPI):
4415         (WebKit::toCopiedAPI): Remove null string check...
4416
4417         * Shared/WebString.h:
4418         (WebKit::WebString::WebString): ... and move it to the constructor.
4419
4420         * Shared/API/c/WKURL.cpp:
4421         (WKURLCopyString): Use toCopiedAPI() instead of calling WebString directly
4422         to match other similar uses.