WebKit2: Need API to stop loading a WKFrame
[WebKit.git] / Source / WebKit2 / ChangeLog
1 2011-01-21  Brian Weinstein  <bweinstein@apple.com>
2
3         Reviewed by Adam Roben.
4
5         WebKit2: Need API to stop loading a WKFrame
6         https://bugs.webkit.org/show_bug.cgi?id=52925
7
8         * UIProcess/API/C/WKFrame.cpp:
9         (WKFrameStopLoading): Call through to WebFrameProxy::stopLoading.
10         * UIProcess/API/C/WKFrame.h:
11         * UIProcess/WebFrameProxy.cpp:
12         (WebKit::WebFrameProxy::stopLoading): Send a message to the WebProcess to stop loading the frame
13             with the passed in ID.
14         * UIProcess/WebFrameProxy.h:
15         * WebProcess/WebPage/WebPage.cpp:
16         (WebKit::WebPage::stopLoadingFrame): Call stopForUserCancel on the passed-in frame.
17         * WebProcess/WebPage/WebPage.h:
18         * WebProcess/WebPage/WebPage.messages.in: Add StopLoadingFrame.
19
20 2011-01-21  Brady Eidson  <beidson@apple.com>
21
22         Reviewed by Adam Roben.
23
24         <rdar://problem/8894125> and https://bugs.webkit.org/show_bug.cgi?id=52916
25         Expose "suggested filename" for a resource based on its resource response.
26
27         API pieces:
28         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
29         (WKBundleFrameCopySuggestedFilenameForResourceURL):
30         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
31         
32         Implementation:
33         * WebProcess/WebPage/WebFrame.cpp:
34         (WebKit::WebFrame::suggestedFilenameForResourceURL): See if the DocumentLoader has
35           a resource for this URL and, if so, return the response's suggested filename.
36         * WebProcess/WebPage/WebFrame.h:
37
38 2011-01-21  Anders Carlsson  <andersca@apple.com>
39
40         Reviewed by Dan Bernstein.
41
42         DrawingAreaProxyImpl::paint should return the unpainted region
43         https://bugs.webkit.org/show_bug.cgi?id=52918
44
45         * UIProcess/API/mac/WKView.mm:
46         (-[WKView drawRect:]):
47         Add unpaintedRegion parameter.
48
49         * UIProcess/BackingStore.h:
50         (WebKit::BackingStore::size):
51         Add a size getter.
52
53         * UIProcess/DrawingAreaProxyImpl.cpp:
54         (WebKit::DrawingAreaProxyImpl::paint):
55         Initialize the unpainted region to the dirty region, then subtract the painted region.
56
57 2011-01-21  Anders Carlsson  <andersca@apple.com>
58
59         Reviewed by Dan Bernstein and Maciej Stachowiak.
60
61         Fix for <rdar://problem/8896057>
62
63         Give the Web Process access to the PubSub agent.
64
65         * WebProcess/com.apple.WebProcess.sb:
66
67 2011-01-21  Sam Weinig  <sam@webkit.org>
68
69         Reviewed by Anders Carlsson.
70
71         Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
72         https://bugs.webkit.org/show_bug.cgi?id=52779
73
74         Rename ScrollbarClient -> ScrollableArea.
75
76         * UIProcess/win/WebPopupMenuProxyWin.cpp:
77         (WebKit::WebPopupMenuProxyWin::onMouseWheel):
78         (WebKit::WebPopupMenuProxyWin::scrollToRevealSelection):
79         * UIProcess/win/WebPopupMenuProxyWin.h:
80
81 2011-01-21  Adam Roben  <aroben@apple.com>
82
83         Update for WKCACFLayerRenderer -> CACFLayerView rename
84
85         Fixes <http://webkit.org/b/52898> WKCACFLayerRenderer sounds like a render object, but isn't
86
87         Reviewed by Simon Fraser.
88
89         * WebProcess/WebPage/win/LayerBackedDrawingAreaWin.cpp: Just removed all the unnecessary
90         #includes.
91
92 2011-01-20  Darin Adler  <darin@apple.com>
93
94         Reviewed by Dan Bernstein.
95
96         WebKit2: Implement showModalDialog
97         https://bugs.webkit.org/show_bug.cgi?id=52855
98
99         * Shared/WebPageCreationParameters.h: Added canRunModal.
100
101         * UIProcess/API/C/WKPage.h: Added a runModal function pointer to
102         WKPageUIClient. Also removed a lot of redundant typedefs and added
103         a new one, WKPageCallback, for callbacks without arguments or return
104         values.
105
106         * UIProcess/API/qt/qwkpage.cpp:
107         (QWKPage::QWKPage): Added a runModal function pointer of 0.
108
109         * UIProcess/WebPageProxy.cpp:
110         (WebKit::WebPageProxy::creationParameters): Set canRunModal
111         based on return value of WebUIClient::canRunModal.
112
113         * UIProcess/WebPageProxy.h: Added runModal.
114         Calls WebUIClient::runModal.
115
116         * UIProcess/WebPageProxy.messages.in: Added RunModal message.
117         Also removed the periods from the phrases in the comments
118         as Maciej requested a while back.
119
120         * UIProcess/WebUIClient.cpp:
121         (WebKit::WebUIClient::canRunModal): Added. Returns true or false
122         based on whether a runModal function was supplied in the
123         WKPageUIClient structure.
124         (WebKit::WebUIClient::runModal): Added. Calls the runModal
125         function from the WKPageUIClient structure.
126         * UIProcess/WebUIClient.h: Declared the above functions.
127
128         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
129         (WebKit::WebChromeClient::canRunModal): Call through to WebPage.
130         (WebKit::WebChromeClient::runModal): Ditto.
131
132         * WebProcess/WebPage/WebPage.cpp:
133         (WebKit::WebPage::WebPage): Initialize m_canRunModal based on the
134         creation parameters. Initialize m_isRunningModal to false.
135         (WebKit::WebPage::close): Stop the nested run loop if we are running modal.
136         (WebKit::WebPage::runModal): Send a message to ask the UI process to run
137         modal and then start a nested run loop. It gets stopped when the page is closed.
138         * WebProcess/WebPage/WebPage.h: Defined the canRunModal function
139         and declared the runModal function.
140
141 2011-01-20  Alexey Proskuryakov  <ap@apple.com>
142
143         Reviewed by Darin Adler.
144
145         https://bugs.webkit.org/show_bug.cgi?id=52849
146         Make window.print work with WebKit2
147
148         * UIProcess/API/qt/qwkpage.cpp:
149         (QWKPage::QWKPage):
150         * UIProcess/WebPageProxy.cpp:
151         (WebKit::WebPageProxy::printFrame):
152         * UIProcess/WebPageProxy.h:
153         * UIProcess/WebPageProxy.messages.in:
154         * UIProcess/WebUIClient.cpp:
155         (WebKit::WebUIClient::printFrame):
156         * UIProcess/WebUIClient.h:
157         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
158         (WebKit::WebChromeClient::print):
159         Just pass through deelagte call to a WebKit2 client.
160
161         * UIProcess/API/C/WKPage.h: Also added "Callback" suffix to other printing related function
162         types.
163
164 2011-01-20  Anders Carlsson  <andersca@apple.com>
165
166         Reviewed by Darin Adler.
167
168         Keep track of the latest update timestamp in the backing store
169         https://bugs.webkit.org/show_bug.cgi?id=52848
170
171         * Shared/UpdateInfo.h:
172         (WebKit::UpdateInfo::UpdateInfo):
173         Initialize timestamp to 0.
174
175         * UIProcess/BackingStore.cpp:
176         (WebKit::BackingStore::BackingStore):
177         Initialize m_latestUpdateTimestamp to 0.
178
179         (WebKit::BackingStore::incorporateUpdate):
180         If the update is too old, discard it. Otherwise, create a bitmap
181         and pass it to platformIncorporateUpdate. Finally update the timestamp.
182
183         * UIProcess/BackingStore.h:
184         Add m_latestUpdateTimestamp.
185
186         * UIProcess/mac/BackingStoreMac.mm:
187         (WebKit::BackingStore::platformIncorporateUpdate):
188         Update now that we are already given the shareable bitmap.
189
190 2011-01-20  Beth Dakin  <bdakin@apple.com>
191
192         Reviewed by Geoffrey Garen.
193
194         Fix for <rdar://problem/8890255>
195
196         Allow WebKitSystemInterface to draw scrollbars 
197         when appropriate.
198         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
199         (InitWebCoreSystemInterface):
200
201 2011-01-20  Sam Weinig  <sam@webkit.org>
202
203         Reviewed by Dave Hyatt.
204
205         Cleanup Scrollbar/ScrollbarClient relationship
206         https://bugs.webkit.org/show_bug.cgi?id=52779
207
208         * UIProcess/win/WebPopupMenuProxyWin.cpp:
209         (WebKit::WebPopupMenuProxyWin::scrollPosition):
210         (WebKit::WebPopupMenuProxyWin::setScrollOffset):
211         (WebKit::WebPopupMenuProxyWin::scrollTo):
212         (WebKit::WebPopupMenuProxyWin::onMouseWheel):
213         (WebKit::WebPopupMenuProxyWin::scrollToRevealSelection):
214         * UIProcess/win/WebPopupMenuProxyWin.h:
215         (WebKit::WebPopupMenuProxyWin::verticalScrollbar):
216
217 2011-01-20  Anders Carlsson  <andersca@apple.com>
218
219         Reviewed by Adam Roben.
220
221         Add a timestamp to UpdateInfo
222         https://bugs.webkit.org/show_bug.cgi?id=52844
223
224         * Shared/UpdateInfo.cpp:
225         (WebKit::UpdateInfo::encode):
226         (WebKit::UpdateInfo::decode):
227         * Shared/UpdateInfo.h:
228         * WebProcess/WebPage/DrawingAreaImpl.cpp:
229         (WebKit::DrawingAreaImpl::setSize):
230         (WebKit::DrawingAreaImpl::display):
231
232 2011-01-20  Anders Carlsson  <andersca@apple.com>
233
234         Reviewed by Beth Dakin.
235
236         Add Connection::waitForAndDispatchImmediately
237         https://bugs.webkit.org/show_bug.cgi?id=52841
238
239         * Platform/CoreIPC/Connection.h:
240         (CoreIPC::Connection::waitForAndDispatchImmediately):
241
242 2011-01-20  Kevin Decker  <kdecker@apple.com>
243
244         Reviewed by Anders Carlsson.
245
246         <rdar://problem/8880689> need a way to obtain the rendered rectangle for box elements
247         https://bugs.webkit.org/show_bug.cgi?id=52823
248         
249         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
250         (WKBundleNodeHandleGetRenderRect): Added new method that will return a rendered rectangle for box elements
251         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: Ditto.
252         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: Ditto.
253         (WebKit::InjectedBundleNodeHandle::renderRect): Ditto.
254         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: Ditto.
255
256 2011-01-20  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
257
258         Reviewed by Andreas Kling.
259
260         Remove null ptr deref that happens when reattaching to
261         a new web process.
262
263         Implement didRelaunchProcess that sets the drawing area size
264         after the drawing area is re-instantiated.
265
266         [Qt][WK2] Null ptr deref in UI process after web process has crashed
267         https://bugs.webkit.org/show_bug.cgi?id=52796
268
269         * UIProcess/API/qt/qgraphicswkview.cpp:
270         (QGraphicsWKView::QGraphicsWKView):
271         * UIProcess/API/qt/qwkpage.cpp:
272         (QWKPagePrivate::QWKPagePrivate):
273         (QWKPagePrivate::init):
274         (QWKPagePrivate::createDrawingAreaProxy):
275         (QWKPagePrivate::didRelaunchProcess): Reset drawing area size after crash.
276         * UIProcess/API/qt/qwkpage_p.h:
277
278 2011-01-20  Maciej Stachowiak  <mjs@apple.com>
279
280         Reviewed by Adam Roben.
281
282         WebKitTestRunner needs to support layoutTestController.evaluateScriptInIsolatedWorld
283         https://bugs.webkit.org/show_bug.cgi?id=42327
284         
285         Added a new API call, WKBundleFrameForJavaScriptContext, that gets the WKBundleFrameRef
286         that corresponds to a JSContextRef (or null if none).
287
288         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
289         (WKBundleFrameForJavaScriptContext): Simple wrapper, defers to a WebFrame
290         static method.
291         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
292         * WebProcess/WebPage/WebFrame.cpp:
293         (WebKit::WebFrame::frameForContext): Follow the maze of twisty pointers.
294         * WebProcess/WebPage/WebFrame.h:
295
296 2011-01-20  Alejandro G. Castro  <alex@igalia.com>
297
298         Fix compilation error in GTK WebKit2.
299
300         * Platform/CoreIPC/gtk/ConnectionGtk.cpp:
301         (CoreIPC::readBytesFromSocket):
302         (CoreIPC::writeBytesToSocket):
303
304 2011-01-20  Zoltan Horvath  <zoltan@webkit.org>
305
306         Reviewed by Csaba Osztrogonác.
307
308         Refactoring of the custom allocation framework
309         https://bugs.webkit.org/show_bug.cgi?id=49897
310
311         Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
312         The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
313         equivalent macro implementation at the necessary places.
314
315 2011-01-19  Simon Fraser  <simon.fraser@apple.com>
316
317         Fix the WebKit2 build.
318
319         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
320         (WebKit::LayerBackedDrawingArea::syncCompositingLayers):
321
322 2011-01-19  Brian Weinstein  <bweinstein@apple.com>
323
324         Reviewed by Darin Adler.
325
326         WebKit2: Need API to get the parent frame of a frame
327         https://bugs.webkit.org/show_bug.cgi?id=52774
328         
329         Add the API to get the parent frame of a frame.
330
331         * UIProcess/API/C/WKFrame.cpp:
332         (WKFrameGetParentFrame):
333         * UIProcess/API/C/WKFrame.h:
334
335 2011-01-19  Enrica Casucci  <enrica@apple.com>
336
337         Reviewed by Darin Adler.
338
339         WebKit2: add support for drag and drop
340         https://bugs.webkit.org/show_bug.cgi?id=52343
341         <rdar://problem/7660558>
342         
343         This patch contains the remaining work to support drag and drop on Mac.
344         I've added a PasteboardTypes class to encapsulate all the pasteboard formats
345         supported for drag and drop.
346         In this implementation we don't support the promised types, since I could not
347         find an efficient way to do this across processes.
348         The bulk of the patch consists in creating a shareable bitmap for the drag image,
349         pass its handle to the UI process and create a new NSImage from it to be given to
350         AppKit for dragging.
351         I've added the missing implementation of the methods in the drag client to hook
352         up the placement of the data in the pasteboard.
353         
354         * Shared/mac/PasteboardTypes.h: Added.
355         * Shared/mac/PasteboardTypes.mm: Added.
356         (WebKit::PasteboardTypes::forEditing):
357         (WebKit::PasteboardTypes::forURL):
358         (WebKit::PasteboardTypes::forImages):
359         (WebKit::PasteboardTypes::forImagesWithArchive):
360         * UIProcess/API/mac/PageClientImpl.h:
361         * UIProcess/API/mac/PageClientImpl.mm:
362         (WebKit::PageClientImpl::setDragImage): Added.
363         * UIProcess/API/mac/WKView.mm:
364         (-[WKView _registerDraggedTypes]): Refactored to use the new PasteboardTypes class.
365         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
366         (-[WKView _setMouseDownEvent:]):
367         (-[WKView _mouseHandler:]):
368         (-[WKView mouseDown:]):
369         (-[WKView mouseUp:]):
370         (-[WKView mouseDragged:]):
371         (-[WKView draggedImage:endedAt:operation:]):
372         (-[WKView draggingEntered:]):
373         (-[WKView _setDragImage:at:linkDrag:]):
374         * UIProcess/API/mac/WKViewInternal.h:
375         * UIProcess/PageClient.h:
376         * UIProcess/WebPageProxy.cpp:
377         (WebKit::WebPageProxy::setDragImage):
378         (WebKit::WebPageProxy::dragEnded):
379         * UIProcess/WebPageProxy.h:
380         * UIProcess/WebPageProxy.messages.in:
381         * WebKit2.xcodeproj/project.pbxproj:
382         * WebProcess/WebCoreSupport/WebDragClient.cpp:
383         * WebProcess/WebCoreSupport/WebDragClient.h:
384         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: Added.
385         (WebKit::fontFromNSFont):
386         (WebKit::WebDragClient::startDrag): Added implementation.
387         (WebKit::WebDragClient::createDragImageForLink): Ditto.
388         (WebKit::writeURL): Helper function.
389         (WebKit::writeImage): Helper function.
390         (WebKit::WebDragClient::declareAndWriteDragImage): Added implementation.
391         * WebProcess/WebPage/WebPage.cpp:
392         (WebKit::WebPage::dragEnded):
393         * WebProcess/WebPage/WebPage.h:
394         * WebProcess/WebPage/WebPage.messages.in:
395
396 2011-01-19  Anders Carlsson  <andersca@apple.com>
397
398         Reviewed by Dan Bernstein.
399
400         Put the deprecated Connection member functions next to eachother
401         https://bugs.webkit.org/show_bug.cgi?id=52767
402
403         * Platform/CoreIPC/Connection.h:
404         (CoreIPC::Connection::sendSync):
405         (CoreIPC::Connection::send):
406
407 2011-01-19  Anders Carlsson  <andersca@apple.com>
408
409         Reviewed by Sam Weinig.
410
411         When resizing, the web process should repaint the page
412         https://bugs.webkit.org/show_bug.cgi?id=52764
413
414         * UIProcess/DrawingAreaProxyImpl.cpp:
415         (WebKit::DrawingAreaProxyImpl::didSetSize):
416         Incorporate the update.
417
418         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
419         Return early if the update bounds rect is empty. This can happen if painting is
420         disabled and we get a DidSetSize message.
421
422         * WebProcess/WebPage/DrawingAreaImpl.cpp:
423         (WebKit::DrawingAreaImpl::setSize):
424         If painting is disabled, just send back an empty UpdateInfo struct. Otherwise,
425         paint and fill in the UpdateInfo struct.
426
427         (WebKit::DrawingAreaImpl::display):
428         Assert that painting is not disabled.
429
430 2011-01-19  Alexey Proskuryakov  <ap@apple.com>
431
432         Reviewed by Darin Adler.
433
434         https://bugs.webkit.org/show_bug.cgi?id=52739
435         Make it possible for a WebKit2 client to print headers and footers
436
437         * UIProcess/API/C/WKPage.h:
438         * UIProcess/WebPageProxy.cpp:
439         (WebKit::WebPageProxy::headerHeight):
440         (WebKit::WebPageProxy::footerHeight):
441         (WebKit::WebPageProxy::drawHeader):
442         (WebKit::WebPageProxy::drawFooter):
443         * UIProcess/WebPageProxy.h:
444         * UIProcess/WebUIClient.cpp:
445         (WebKit::WebUIClient::headerHeight):
446         (WebKit::WebUIClient::footerHeight):
447         (WebKit::WebUIClient::drawHeader):
448         (WebKit::WebUIClient::drawFooter):
449         * UIProcess/WebUIClient.h:
450         Pass UIClient calls through.
451
452         * UIProcess/API/mac/WKView.mm:
453         (currentPrintOperationScale): A helper to extract scale factor from the current NSPrintOperation.
454         (-[WKView _adjustPrintingMarginsForHeaderAndFooter]): Copied from WebKit1. Change current
455         print info to account for header and footer height as provided by the client.
456         (-[WKView knowsPageRange:]): Call -[self _adjustPrintingMarginsForHeaderAndFooter].
457         (-[WKView drawPageBorderWithSize:]): When AppKit asks to print page border, call the client
458         to do that. Code adapted form WebKit1.
459
460         * UIProcess/API/qt/qwkpage:
461         (QWKPage::QWKPage): Added zeroes for new WKPageUIClient members to avoid breaking the build.
462
463 2011-01-19  Jessie Berlin  <jberlin@apple.com>
464
465         Reviewed by Darin Adler.
466
467         Crash in WebDatabaseManagerProxy::getDatabaseOrigins when called after the WebProcess has
468         died at least once
469         https://bugs.webkit.org/show_bug.cgi?id=52730
470
471         WebDatabaseManagerProxy::invalidate was setting m_webContext to 0, and invalidate gets
472         called in WebContext::processDidClose. However, m_webContext is only set in the
473         constructor, which is only called from the constructor of WebContext, so attempting to send
474         a message to any new WebProcess after the first one died was causing a null deref.
475
476         This patch moves setting m_webcontext into clearContext and clearContext is only called in
477         the WebContext destructor.
478
479         This patch also adds checks for a valid WebProcessProxy before attempting to send messages to
480         the WebProcessProxy so that if the WebProcess has died and has not been revived, it does not
481         attempt to dereference a null WebProcessProxy.
482
483         * UIProcess/WebContext.cpp:
484         (WebKit::WebContext::~WebContext):
485         Call WebDatabaseManagerProxy::clearContext.
486         * UIProcess/WebContext.h:
487         (WebKit::WebContext::hasValidProcess):
488         Make this method public so that it can be called from WebDatabaseManagerProxy.
489
490         * UIProcess/WebDatabaseManagerProxy.cpp:
491         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
492         If there isn't a valid process, invalidate the callback and return early.
493         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
494         Ditto.
495         (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
496         If tehre isn't a valid process return early.
497         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
498         Ditto.
499         (WebKit::WebDatabaseManagerProxy::deleteAllDatabases):
500         Ditto.
501         (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
502         Ditto.
503         (WebKit::WebDatabaseManagerProxy::invalidate):
504         Move setting m_webContext to 0 from here ...
505         * UIProcess/WebDatabaseManagerProxy.h:
506         (WebKit::WebDatabaseManagerProxy::clearContext):
507         ... to here.
508
509 2011-01-19  Anders Carlsson  <andersca@apple.com>
510
511         Reviewed by Sam Weinig.
512
513         Suspend/resume painting as the WKView visibility changes
514         https://bugs.webkit.org/show_bug.cgi?id=52738
515
516         * UIProcess/DrawingAreaProxy.h:
517         (WebKit::DrawingAreaProxy::visibilityDidChange):
518         Add new member function. It should really be pure virtual once setPageIsVisible
519         is removed.
520
521         * UIProcess/DrawingAreaProxyImpl.cpp:
522         (WebKit::DrawingAreaProxyImpl::visibilityDidChange):
523         Send SuspendPainting/ResumePainting messages based on whether the view is visible or not.
524
525         (WebKit::DrawingAreaProxyImpl::setPageIsVisible):
526         Make this a stub; it should really be removed.
527
528         * UIProcess/WebPageProxy.cpp:
529         (WebKit::WebPageProxy::viewStateDidChange):
530         Call visibilityDidChange.
531
532         * UIProcess/WebPageProxy.h:
533         (WebKit::WebPageProxy::isViewVisible):
534         Add new getter.
535
536         * WebProcess/WebPage/DrawingArea.messages.in:
537         Add SuspendPainting and ResumePainting messages.
538
539         * WebProcess/WebPage/DrawingAreaImpl.cpp:
540         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
541         Initialize m_isPaintingSuspended.
542
543         (WebKit::DrawingAreaImpl::suspendPainting):
544         Set m_isPaintingSuspended to true and stop the display timer.
545
546         (WebKit::DrawingAreaImpl::resumePainting):
547         Set m_isPaintingSuspended to false.
548
549         (WebKit::DrawingAreaImpl::scheduleDisplay):
550         (WebKit::DrawingAreaImpl::display):
551         Bail if m_isPaintingSuspended is true.
552
553 2011-01-19  Andreas Kling  <kling@webkit.org>
554
555         Reviewed by Simon Hausmann.
556
557         [Qt][WK2] Implement formatLocalizedString() for Qt.
558
559         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
560         (WebKit::formatLocalizedString):
561
562 2011-01-19  Chris Marrin  <cmarrin@apple.com>
563
564         Reviewed by Simon Fraser.
565
566         WK2 - Multiple crashes in PlatformCALayer::replaceSublayer
567         https://bugs.webkit.org/show_bug.cgi?id=52695
568
569         Added a hostingLayer as the parent of the existing drawingLayer.
570         The hostingLayer is now the root which is passed to the 
571         remote context. It never changes except to track the size
572         of the window. The backingLayer is now a child of the 
573         hostingLayer, which allow it to switch between tiled and
574         non-tiled.
575
576         I also now give back accurate settings for debug borders and
577         repaint counters.
578
579         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
580         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
581         (WebKit::LayerBackedDrawingArea::setSize):
582         (WebKit::LayerBackedDrawingArea::showDebugBorders):
583         (WebKit::LayerBackedDrawingArea::showRepaintCounter):
584         * WebProcess/WebPage/LayerBackedDrawingArea.h:
585         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
586         (WebKit::LayerBackedDrawingArea::platformInit):
587         (WebKit::LayerBackedDrawingArea::attachCompositingContext):
588         (WebKit::LayerBackedDrawingArea::syncCompositingLayers):
589
590 2011-01-19  Anders Carlsson  <andersca@apple.com>
591
592         Reviewed by Sam Weinig.
593
594         Send a new SetSize message if the size differs from the current size
595         https://bugs.webkit.org/show_bug.cgi?id=52728
596
597         * UIProcess/DrawingAreaProxy.h:
598         (WebKit::DrawingAreaProxy::didSetSize):
599         Add UpdateInfo parameter.
600
601         * UIProcess/DrawingAreaProxy.messages.in:
602         Add UpdateInfo parameter to the DidSetSize message.
603
604         * UIProcess/DrawingAreaProxyImpl.cpp:
605         (WebKit::DrawingAreaProxyImpl::didSetSize):
606         If the view size differs from the current size send another SetSize message.
607
608         * UIProcess/DrawingAreaProxyImpl.h:
609         Add UpdateInfo parameter to didSetSize.
610
611         * WebProcess/WebPage/DrawingAreaImpl.cpp:
612         (WebKit::DrawingAreaImpl::setSize):
613         The DidSetSize message now takes an UpdateInfo parameter.
614
615 2011-01-19  Anders Carlsson  <andersca@apple.com>
616
617         Reviewed by Darin Adler.
618
619         Throttle sending of SetSize messages
620         https://bugs.webkit.org/show_bug.cgi?id=52727
621
622         * UIProcess/DrawingAreaProxyImpl.cpp:
623         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
624         Initialize m_isWaitingForDidSetSize to false.
625
626         (WebKit::DrawingAreaProxyImpl::didSetSize):
627         Null out the backing store.
628
629         (WebKit::DrawingAreaProxyImpl::sendSetSize):
630         If m_isWaitingForDidSetSize is true, do nothing. Otherwise, set m_isWaitingForDidSetSize
631         to true and send a SetSize message.
632
633         * UIProcess/DrawingAreaProxyImpl.h:
634         Add m_isWaitingForDidSetSize.
635
636 2011-01-19  Anders Carlsson  <andersca@apple.com>
637
638         Reviewed by Darin Adler.
639
640         Pass WebPageCreationParameters to DrawingArea::create
641         https://bugs.webkit.org/show_bug.cgi?id=52726
642
643         * WebProcess/WebPage/DrawingArea.cpp:
644         (WebKit::DrawingArea::create):
645         * WebProcess/WebPage/DrawingArea.h:
646         * WebProcess/WebPage/DrawingAreaImpl.cpp:
647         (WebKit::DrawingAreaImpl::create):
648         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
649         * WebProcess/WebPage/DrawingAreaImpl.h:
650         * WebProcess/WebPage/WebPage.cpp:
651         (WebKit::WebPage::WebPage):
652         (WebKit::WebPage::changeAcceleratedCompositingMode):
653
654 2011-01-19  Csaba Osztrogonác  <ossy@webkit.org>
655
656         Reviewed by Laszlo Gombos and Tor Arne Vestbø.
657
658         [Qt] Remove unnecessary "../Source" from paths
659         after moving source files into Source is finished.
660
661         * DerivedSources.pro:
662         * WebKit2.pro:
663
664 2011-01-18  Maciej Stachowiak  <mjs@apple.com>
665
666         Reviewed by Sam Weinig.
667
668         WebKitTestRunner should track loading more like DumpRenderTree
669         https://bugs.webkit.org/show_bug.cgi?id=52692
670         
671         Relax the message check in didSaveFrameToPageCache a bit more, since
672         layout tests were still hitting the old one.
673
674         * UIProcess/WebPageProxy.cpp:
675         (WebKit::isDisconnectedFrame):
676         (WebKit::WebPageProxy::didSaveFrameToPageCache):
677
678 2011-01-18  Brady Eidson  <beidson@apple.com>
679
680         Reviewed by Darin Adler.
681
682         <rdar://problem/8860833> and https://bugs.webkit.org/show_bug.cgi?id=52599
683         UIProcess crash in WebPageProxy::reattachToWebProcess when web process crashes with a new tab/window.
684
685         * UIProcess/WebPageProxy.cpp:
686         (WebKit::WebPageProxy::reattachToWebProcessWithItem): Null check item *both* places it is used.
687
688 2011-01-18  Brady Eidson  <beidson@apple.com>
689
690         Reviewed by Maciej Stachowiak. 
691
692         <rdar://problem/8752200> and https://bugs.webkit.org/show_bug.cgi?id=52664
693         Need WebKit2 API to asynchronously get the resource data for a URL
694
695         Rename WKFrameGetMainResourceDataFunction to WKFrameGetResourceDataFunction, and add
696         new API to get a resource by URL:
697         * UIProcess/API/C/WKFrame.cpp:
698         (WKFrameGetMainResourceData):
699         (WKFrameGetResourceData):
700         (callGetResourceDataBlockAndDispose):
701         (WKFrameGetMainResourceData_b):
702         (WKFrameGetResourceData_b):
703         * UIProcess/API/C/WKFrame.h:
704
705         Implement the new API in the UIProcess side:
706         * UIProcess/WebFrameProxy.cpp:
707         (WebKit::WebFrameProxy::getResourceData):
708         * UIProcess/WebFrameProxy.h:
709         * UIProcess/WebPageProxy.cpp:
710         (WebKit::WebPageProxy::getResourceDataFromFrame):
711         * UIProcess/WebPageProxy.h:
712
713         Have the WebProcess get the data and call back to the UIProcess:
714         * WebProcess/WebPage/WebPage.cpp:
715         (WebKit::WebPage::getResourceDataFromFrame):
716         * WebProcess/WebPage/WebPage.h:
717         * WebProcess/WebPage/WebPage.messages.in:
718
719 2011-01-18  Anders Carlsson  <andersca@apple.com>
720
721         Reviewed by Dan Bernstein.
722
723         Make PageClientImpl::scrollView do hardware blitting
724         https://bugs.webkit.org/show_bug.cgi?id=52689
725
726         * UIProcess/API/mac/PageClientImpl.mm:
727         (WebKit::PageClientImpl::scrollView):
728         Clip the scroll rect and scroll the view.
729
730         * UIProcess/DrawingAreaProxyImpl.cpp:
731         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
732         Scroll before painting.
733
734 2011-01-18  Anders Carlsson  <andersca@apple.com>
735
736         Reviewed by Darin Adler.
737
738         Artifacts when scrolling with new drawing area
739         https://bugs.webkit.org/show_bug.cgi?id=52682
740
741         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
742         (WebKit::WebChromeClient::scroll):
743         When scrolling, we want the intersection of the scroll rect and clip rect.
744
745 2011-01-18  Anders Carlsson  <andersca@apple.com>
746
747         Reviewed by Darin Adler.
748
749         Use a CGLayer for the backing store when possible
750         https://bugs.webkit.org/show_bug.cgi?id=52679
751
752         * UIProcess/mac/BackingStoreMac.mm:
753         (WebKit::BackingStore::paint):
754         If there is a layer, paint it into the given context.
755
756         (WebKit::BackingStore::backingStoreContext):
757         If we can get the containing window graphics context, use it to create a 
758         CGLayer that we'll use for the backing store.
759
760         (WebKit::BackingStore::scroll):
761         Paint the layer into itself.
762
763         * UIProcess/mac/WebPageProxyMac.mm:
764         (WebKit::WebPageProxy::containingWindowGraphicsContext):
765         Call the page client.
766
767 2011-01-18  Anders Carlsson  <andersca@apple.com>
768
769         Reviewed by Dan Bernstein.
770
771         Pass the web page proxy to BackingStore::create
772         https://bugs.webkit.org/show_bug.cgi?id=52673
773
774         * UIProcess/BackingStore.cpp:
775         (WebKit::BackingStore::create):
776         Add WebPageProxy parameter.
777     
778         (WebKit::BackingStore::BackingStore):
779         Add WebPageProxy parameter.
780
781         * UIProcess/BackingStore.h:
782         Add WebPageProxy member variable.
783
784         * UIProcess/DrawingAreaProxyImpl.cpp:
785         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
786         Pass the web page proxy when creating the backing store.
787
788         * UIProcess/mac/BackingStoreMac.mm:
789         (WebKit::BackingStore::backingStoreContext):
790         Set the default blend mode.
791
792 2011-01-18  Anders Carlsson  <andersca@apple.com>
793
794         Reviewed by Darin Adler.
795
796         Factor code to create the backing store bitmap context out into a new function
797         https://bugs.webkit.org/show_bug.cgi?id=52670
798
799         * UIProcess/BackingStore.h:
800         * UIProcess/mac/BackingStoreMac.mm:
801         (WebKit::BackingStore::backingStoreContext):
802         Create the backing store context.
803
804         (WebKit::BackingStore::incorporateUpdate):
805         Call backingStoreContext.
806
807         (WebKit::BackingStore::scroll):
808         Assert that the context is not null.
809
810 2011-01-18  Anders Carlsson  <andersca@apple.com>
811
812         Reviewed by Dan Bernstein.
813
814         Add PageClientImpl::containingWindowGraphicsContext
815         https://bugs.webkit.org/show_bug.cgi?id=52666
816
817         * UIProcess/API/mac/PageClientImpl.h:
818         * UIProcess/API/mac/PageClientImpl.mm:
819         (WebKit::PageClientImpl::containingWindowGraphicsContext):
820         * UIProcess/PageClient.h:
821         * UIProcess/WebPageProxy.h:
822
823 2011-01-18  Damian Kaleta  <dkaleta@apple.com>
824
825         Reviewed by Sam Weinig.
826
827         WK2 methods WKPageScaleWebView and WKPageGetViewScaleFactor need to have consistent names
828         https://bugs.webkit.org/show_bug.cgi?id=52647
829
830         * UIProcess/API/C/WKPage.cpp:
831         (WKPageSetScaleFactor):
832         (WKPageGetScaleFactor):
833         * UIProcess/API/C/WKPage.h:
834
835 2011-01-18  Anders Carlsson  <andersca@apple.com>
836
837         Reviewed by Dan Bernstein.
838
839         Ask the web page proxy to scroll the view when needed
840         https://bugs.webkit.org/show_bug.cgi?id=52665
841
842         * UIProcess/DrawingAreaProxyImpl.cpp:
843         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
844         * UIProcess/WebPageProxy.cpp:
845         (WebKit::WebPageProxy::scrollView):
846         * UIProcess/WebPageProxy.h:
847
848 2011-01-18  Anders Carlsson  <andersca@apple.com>
849
850         Fix build.
851
852         * UIProcess/win/WebView.cpp:
853         (WebKit::WebView::scrollView):
854
855 2011-01-18  Anders Carlsson  <andersca@apple.com>
856
857         Reviewed by Sam Weinig.
858
859         Add PageClient::scrollView
860         https://bugs.webkit.org/show_bug.cgi?id=52663
861
862         * UIProcess/API/mac/PageClientImpl.h:
863         * UIProcess/API/mac/PageClientImpl.mm:
864         (WebKit::PageClientImpl::scrollView):
865         * UIProcess/API/qt/qwkpage.cpp:
866         (QWKPagePrivate::scrollView):
867         * UIProcess/API/qt/qwkpage_p.h:
868         * UIProcess/PageClient.h:
869         * UIProcess/win/WebView.cpp:
870         (WebKit::PageClientImpl::scrollView):
871         * UIProcess/win/WebView.h:
872
873 2011-01-18  Anders Carlsson  <andersca@apple.com>
874
875         Reviewed by Sam Weinig.
876
877         Rename scrollDelta to scrollOffset everywhere.
878
879         * Shared/UpdateInfo.cpp:
880         (WebKit::UpdateInfo::encode):
881         (WebKit::UpdateInfo::decode):
882         * Shared/UpdateInfo.h:
883         * UIProcess/BackingStore.h:
884         * UIProcess/mac/BackingStoreMac.mm:
885         (WebKit::BackingStore::incorporateUpdate):
886         (WebKit::BackingStore::scroll):
887         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
888         (WebKit::WebChromeClient::scroll):
889         (WebKit::WebChromeClient::delegatedScrollRequested):
890         * WebProcess/WebCoreSupport/WebChromeClient.h:
891         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
892         (WebKit::ChunkedUpdateDrawingArea::scroll):
893         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
894         * WebProcess/WebPage/DrawingArea.h:
895         * WebProcess/WebPage/DrawingAreaImpl.cpp:
896         (WebKit::DrawingAreaImpl::scroll):
897         (WebKit::DrawingAreaImpl::display):
898         * WebProcess/WebPage/DrawingAreaImpl.h:
899         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
900         (WebKit::LayerBackedDrawingArea::scroll):
901         * WebProcess/WebPage/LayerBackedDrawingArea.h:
902
903 2011-01-18  Anders Carlsson  <andersca@apple.com>
904
905         Reviewed by Sam Weinig.
906
907         Get and paint each individual rect in -[WKView drawRect:]
908         https://bugs.webkit.org/show_bug.cgi?id=52660
909
910         * UIProcess/API/mac/WKView.mm:
911         (-[WKView drawRect:]):
912
913 2011-01-18  Anders Carlsson  <andersca@apple.com>
914
915         Reviewed by Darin Adler.
916
917         Assertion when loading two URLs in quick succession
918         https://bugs.webkit.org/show_bug.cgi?id=52649
919         <rdar://problem/8764645>
920
921         If beginLoad is called twice without didStartProvisionalLoad being called in between,
922         m_pendingProvisionalSandboxExtension would be non-null and an assert would fire.
923
924         * WebProcess/WebPage/WebPage.cpp:
925         (WebKit::WebPage::SandboxExtensionTracker::beginLoad):
926         Instead of asserting that m_pendingProvisionalSandboxExtension is null, invalidate it
927         if it is not null, since that's valid.
928
929 2011-01-18  Anders Carlsson  <andersca@apple.com>
930
931         Reviewed by Sam Weinig.
932
933         Implement NPN_PopUpContextMenu
934         https://bugs.webkit.org/show_bug.cgi?id=52646
935         <rdar://problem/8735616>
936
937         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
938         (WebKit::NPN_PopUpContextMenu):
939         Call NetscapePlugin::popUpContextMenu.
940
941         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
942         (WebKit::NetscapePlugin::NetscapePlugin):
943         Initialize m_currentMouseEvent.
944
945         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
946         Add m_currentMouseEvent.
947
948         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
949         (WebKit::NetscapePlugin::popUpContextMenu):
950         Convert the coordinates from the current mouse event to screen coordinates and call
951         WKPopupContextMenu.
952
953         (WebKit::NetscapePlugin::platformHandleMouseEvent):
954         Update m_currentMouseEvent.
955
956 2011-01-18  Jessie Berlin  <jberlin@apple.com>
957
958         Reviewed by Darin Adler.
959
960         WebKit2: Do not assert that the provisional and committed URLs cannot be empty/null
961         https://bugs.webkit.org/show_bug.cgi?id=52641
962
963         * UIProcess/WebFrameProxy.cpp:
964         (WebKit::WebFrameProxy::didStartProvisionalLoad):
965         (WebKit::WebFrameProxy::didCommitLoad):
966         (WebKit::WebFrameProxy::didFinishLoad):
967
968 2011-01-18  Anders Carlsson  <andersca@apple.com>
969
970         Reviewed by Sam Weinig.
971
972         ASSERT in plug-in code when going to youtube
973         https://bugs.webkit.org/show_bug.cgi?id=52638
974
975         * PluginProcess/PluginControllerProxy.cpp:
976         (WebKit::PluginControllerProxy::paintEntirePlugin):
977         Don't try to paint the plug-in if the plug-in frame is empty.
978
979 2011-01-18  Anders Carlsson  <andersca@apple.com>
980
981         Reviewed by Dan Bernstein.
982
983         Plug-in hosting WebProcess instances appear in Activity Monitor as WebProcess
984         https://bugs.webkit.org/show_bug.cgi?id=52635
985         <rdar://problem/8731337>
986
987         * PluginProcess/PluginProcess.cpp:
988         (WebKit::PluginProcess::initialize):
989         Call platformInitialize.
990
991         * PluginProcess/PluginProcess.h:
992         Add platformInitialize.
993
994         * PluginProcess/mac/PluginProcessMac.mm:
995         (WebKit::PluginProcess::platformInitialize):
996         Set the compositing render server port and the visible application name.
997
998         * Shared/Plugins/PluginProcessCreationParameters.cpp:
999         (WebKit::PluginProcessCreationParameters::encode):
1000         (WebKit::PluginProcessCreationParameters::decode):
1001         Encode/decode the parent process name.
1002
1003         * Shared/Plugins/PluginProcessCreationParameters.h:
1004         Add parentProcessName.
1005
1006         * Shared/WebProcessCreationParameters.cpp:
1007         (WebKit::WebProcessCreationParameters::encode):
1008         (WebKit::WebProcessCreationParameters::decode):
1009         Encode/decode the parent process name.
1010
1011         * Shared/WebProcessCreationParameters.h:
1012         Add parentProcessName.
1013
1014         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1015         (WebKit::ProcessLauncher::launchProcess):
1016         Don't pass the parent process name here.
1017
1018         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1019         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
1020         Set the visible name.
1021
1022         * UIProcess/mac/WebContextMac.mm:
1023         (WebKit::WebContext::platformInitializeWebProcess):
1024         Pass along the parent process name.
1025
1026         * WebProcess/mac/WebProcessMac.mm:
1027         (WebKit::WebProcess::platformInitializeWebProcess):
1028         Set the visible name.
1029
1030         * WebProcess/mac/WebProcessMainMac.mm:
1031         (WebKit::WebProcessMain):
1032         Don't set the visible name here. It's done in platformInitializeWebProcess.
1033
1034 2011-01-18  Balazs Kelemen  <kbalazs@webkit.org>
1035
1036         Reviewed by Csaba Osztrogonác.
1037
1038         [Qt][WK2] Not implemented warnings should not break layout tests
1039         https://bugs.webkit.org/show_bug.cgi?id=52616
1040
1041         * WebKit2Prefix.h: Define DISABLE_NOT_IMPLEMENTED_WARNINGS on Qt.
1042
1043 2011-01-17  Jon Honeycutt  <jhoneycutt@apple.com>
1044
1045         Windows build fix. Unreviewed.
1046
1047         * Shared/PrintInfo.cpp:
1048         Use #include, not #import.
1049
1050 2011-01-17  Alexey Proskuryakov  <ap@apple.com>
1051
1052         Actually wrote a FIXME promised for a review comment.
1053
1054         * UIProcess/API/mac/WKView.mm:
1055         (-[WKView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
1056
1057 2011-01-17  Alexey Proskuryakov  <ap@apple.com>
1058
1059         Reviewed by Anders Carlsson and Darin Adler.
1060
1061         https://bugs.webkit.org/show_bug.cgi?id=52595
1062         Make basic printing work in WebKit2
1063
1064         * Shared/WebPreferencesStore.h:
1065         * UIProcess/API/C/WKPreferences.cpp:
1066         (WKPreferencesSetShouldPrintBackgrounds):
1067         (WKPreferencesGetShouldPrintBackgrounds):
1068         * UIProcess/API/C/WKPreferences.h:
1069         Implement a preference for printing backgrounds.
1070
1071         * Shared/PrintInfo.cpp: Added.
1072         (WebKit::PrintInfo::encode):
1073         (WebKit::PrintInfo::decode):
1074         * Shared/PrintInfo.h: Added.
1075         * Shared/mac/PrintInfoMac.mm: Added.
1076         (WebKit::PrintInfo::PrintInfo):
1077         A new class for passing page setup information down to the web process.
1078
1079         * WebKit2.xcodeproj/project.pbxproj:
1080         * GNUmakefile.am:
1081         * WebKit2.pro:
1082         * win/WebKit2.vcproj:
1083         Added PrintInfo.
1084
1085         * Scripts/webkit2/messages.py: Added PrintInfo.h to a list of structs.
1086
1087         * UIProcess/API/mac/WKView.mm:
1088         (WKViewData): Cache page count and geometry.
1089         (WebFrameWrapper): Added a wrapper class for adding a WebFrameProxy to an NSDictionary.
1090         (-[WKView drawRect:]): Added logging.
1091         (setFrameBeingPrinted): Store a frame into NSPrintOperation's NSPrintInfo, so that all 
1092         methods invoked for this operation would know what's being printed.
1093         (frameBeingPrinted): Retrieve this data.
1094         (-[WKView printOperationWithPrintInfo:forFrame:]): Create a print operation that's appropriate
1095         for the frame.
1096         (-[WKView knowsPageRange:]): Ask the web process.
1097         (-[WKView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
1098         Take over printing, because I couldn't make drawRect: work correctly with WebKit custom fit
1099         to page implementation.
1100         (-[WKView _provideTotalScaleFactorForPrintOperation:]): Help AppKit clip correctly.
1101         (-[WKView rectForPage:]): Return a pre-calculated rect.
1102
1103         * UIProcess/WebPageProxy.h: Added m_isInPrintingMode to track whether the web page is in
1104         printing mode. The UI process controls that.
1105
1106         * UIProcess/WebPageProxy.cpp:
1107         (WebKit::WebPageProxy::WebPageProxy): Initialize m_isInPrintingMode.
1108         (WebKit::WebPageProxy::beginPrinting): Change printing mode in web process if the value changes.
1109         (WebKit::WebPageProxy::endPrinting): Ditto.
1110         (WebKit::WebPageProxy::computePagesForPrinting): Ask the web process about output page geometry.
1111         (WebKit::WebPageProxy::drawRectToPDF): Ask the web process about printed page data.
1112
1113         * WebProcess/WebPage/WebPage.cpp:
1114         (WebKit::WebPage::close): Delete m_printContext while there is still a Frame pointer.
1115         (WebKit::WebPage::updatePreferences): Pass through ShouldPrintBackgrounds.
1116         (WebKit::WebPage::beginPrinting): Switch into printing mode (or update parameters if we're
1117         already in printing mode).
1118         (WebKit::WebPage::endPrinting): Delete m_printContext, implicitly calling end().
1119         (WebKit::WebPage::computePagesForPrinting): Make sure that we're in printing mode, and
1120         copmute page rects.
1121         (WebKit::WebPage::drawRectToPDF): Added a CG specific function to create a PDF document out
1122         of a page rect. It should really work for onscreen content, but we only need it for printing.
1123
1124         * WebProcess/WebPage/WebPage.h:
1125
1126         * WebProcess/WebPage/WebPage.messages.in: Added BeginPrinting, EndPrinting,
1127         ComputePagesForPrinting and DrawRectToPDF.
1128
1129 2011-01-17  Tony Gentilcore  <tonyg@chromium.org>
1130
1131         Reviewed by Alexey Proskuryakov.
1132
1133         Fix some headers with missing or misspelled #ifndef guards
1134         https://bugs.webkit.org/show_bug.cgi?id=52545
1135
1136         * Shared/UserMessageCoders.h:
1137         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
1138         * WebProcess/InjectedBundle/InjectedBundleUserMessageCoders.h:
1139         * WebProcess/WebProcessMain.h:
1140
1141 2011-01-17  Alexey Proskuryakov  <ap@apple.com>
1142
1143         Build fix.
1144
1145         * Platform/Logging.cpp:
1146
1147 2011-01-17  Alexey Proskuryakov  <ap@apple.com>
1148
1149         Reviewed by Dan Bernstein.
1150
1151         https://bugs.webkit.org/show_bug.cgi?id=52592
1152         Add a logging channel for WKView
1153
1154         * Platform/Logging.cpp:
1155         * Platform/Logging.h:
1156
1157 2011-01-17  Anders Carlsson  <andersca@apple.com>
1158
1159         Reviewed by Sam Weinig.
1160
1161         Factor bitmap context drawing code out into a shared function
1162         https://bugs.webkit.org/show_bug.cgi?id=52589
1163
1164         * Platform/cg/CGUtilities.h: Added.
1165         * Platform/cg/CGUtilities.cpp: Added.
1166         (WebKit::paintBitmapContext):
1167         New function that will paint a bitmap context into a CGContext.
1168
1169         * Shared/cg/ShareableBitmapCG.cpp:
1170         (WebKit::ShareableBitmap::paint):
1171         Use paintBitmapContext.
1172
1173         * UIProcess/mac/BackingStoreMac.mm:
1174         (WebKit::BackingStore::paint):
1175         (WebKit::BackingStore::scroll):
1176         Use paintBitmapContext.
1177
1178         * WebKit2.xcodeproj/project.pbxproj:
1179         * win/WebKit2.vcproj:
1180         * win/WebKit2Common.vsprops:
1181         Add CGUtilities.{cpp|h}.
1182
1183 2011-01-17  Dan Bernstein  <mitz@apple.com>
1184
1185         Rubber-stamped by Mark Rowe.
1186
1187         Update xcodeproj svn:ignore to include xcuserdata.
1188
1189         * WebKit2.xcodeproj: Modified property svn:ignore.
1190
1191 2011-01-17  Alexey Proskuryakov  <ap@apple.com>
1192
1193         Fixing a typo from a bad merge.
1194
1195         * UIProcess/API/mac/WKView.mm: (-[WKView canChangeFrameLayout:]):
1196
1197 2011-01-17  Alexey Proskuryakov  <ap@apple.com>
1198
1199         Reviewed by John Sullivan.
1200
1201         https://bugs.webkit.org/show_bug.cgi?id=52590
1202         Should pass a frame into -[WKView canPrintHeadersAndFooters]
1203
1204         * UIProcess/API/mac/WKView.h:
1205         * UIProcess/API/mac/WKView.mm: (-[WKView canChangeFrameLayout:]): Also, renamed the method
1206         to canChangeFrameLayout.
1207
1208 2011-01-17  Anders Carlsson  <andersca@apple.com>
1209
1210         Reviewed by Sam Weinig.
1211
1212         Implement scrolling support
1213         https://bugs.webkit.org/show_bug.cgi?id=52502
1214
1215         * Shared/UpdateInfo.cpp:
1216         (WebKit::UpdateInfo::encode):
1217         (WebKit::UpdateInfo::decode):
1218         * Shared/UpdateInfo.h:
1219         Add scrollRect and scrollDelta member variables.
1220
1221         * UIProcess/BackingStore.h:
1222         Add scroll member function.
1223
1224         * UIProcess/DrawingAreaProxyImpl.cpp:
1225         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
1226         Repaint the scroll rect. Force a display of the view when the update info contains a scroll rect.
1227
1228         * UIProcess/mac/BackingStoreMac.mm:
1229         (WebKit::BackingStore::incorporateUpdate):
1230         Call scroll.
1231
1232         (WebKit::BackingStore::scroll):
1233         Paint the backing store into itself.
1234
1235         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1236         (WebKit::DrawingAreaImpl::display):
1237         Pass the scroll information in the update info.
1238
1239 2011-01-17  Andrey Kosyakov  <caseq@chromium.org>
1240
1241         Unreviewed. Fixed malformed reference to WebKitVSPropsRedirectionDir that broke win build.
1242
1243         * win/WebKit2.vcproj:
1244         * win/WebKit2GeneratedCommon.vsprops:
1245         * win/WebKit2WebProcess.vcproj:
1246
1247 2011-01-17  Pavel Feldman  <pfeldman@chromium.org>
1248
1249         Reviewed by Yury Semikhatsky.
1250
1251         Web Inspector: simplify debugger enabling routine.
1252         https://bugs.webkit.org/show_bug.cgi?id=52472
1253
1254         * WebProcess/WebPage/WebInspector.cpp:
1255         (WebKit::WebInspector::startJavaScriptDebugging):
1256
1257 2011-01-17  Balazs Kelemen  <kbalazs@webkit.org>
1258
1259         Reviewed by Andreas Kling.
1260
1261         [Qt][WK2] Crash due to double destruction of QSharedMemory
1262         https://bugs.webkit.org/show_bug.cgi?id=52569
1263
1264         Avoid deleting the QSharedMemory twice.
1265         * Platform/qt/SharedMemoryQt.cpp:
1266         (WebKit::SharedMemory::~SharedMemory):
1267         * Shared/qt/CleanupHandler.cpp:
1268         Renamed m_inDeleteObjects to m_hasStartedDeleting and
1269         added a getter for it.
1270         (WebKit::CleanupHandler::CleanupHandler):
1271         (WebKit::CleanupHandler::deleteObjects):
1272         * Shared/qt/CleanupHandler.h:
1273         (WebKit::CleanupHandler::unmark):
1274         (WebKit::CleanupHandler::hasStartedDeleting):
1275
1276 2011-01-15  Adam Barth  <abarth@webkit.org>
1277
1278         Rubber-stamped by Eric Seidel.
1279
1280         Move WebKit2 into Source
1281         https://bugs.webkit.org/show_bug.cgi?id=52438
1282
1283         * DerivedSources.pro:
1284         * GNUmakefile.am:
1285         * WebKit2.pro:
1286         * WebProcess.pro:
1287         * win/WebKit2.vcproj:
1288         * win/WebKit2WebProcess.vcproj:
1289
1290 2011-01-14  Yuzo Fujishima  <yuzo@google.com>
1291
1292         Reviewed by Antti Koivisto.
1293
1294         Rename cache() to memoryCache()
1295         https://bugs.webkit.org/show_bug.cgi?id=52433
1296
1297         * WebProcess/WebProcess.cpp:
1298         (WebKit::WebProcess::shutdownIfPossible):
1299         (WebKit::WebProcess::didClose):
1300         * WebProcess/mac/WebProcessMac.mm:
1301         (WebKit::WebProcess::platformSetCacheModel):
1302         * WebProcess/win/WebProcessWin.cpp:
1303         (WebKit::WebProcess::platformSetCacheModel):
1304
1305 2011-01-13  Geoffrey Garen  <ggaren@apple.com>
1306
1307         Reviewed by Oliver Hunt.
1308
1309         Split out a MarkedSpace strategy object from Heap.
1310         https://bugs.webkit.org/show_bug.cgi?id=52421
1311
1312         * Shared/mac/WebMemorySampler.mac.mm:
1313         (WebKit::WebMemorySampler::sampleWebKit): Updated for class move.
1314
1315 2011-01-14  Anders Carlsson  <andersca@apple.com>
1316
1317         Reviewed by Dan Bernstein.
1318
1319         Add a new PageClient::displayView function and expose it on WebPageProxy
1320         https://bugs.webkit.org/show_bug.cgi?id=52500
1321
1322         * UIProcess/API/mac/PageClientImpl.h:
1323         * UIProcess/API/mac/PageClientImpl.mm:
1324         (WebKit::PageClientImpl::displayView):
1325         * UIProcess/API/qt/qwkpage.cpp:
1326         (QWKPagePrivate::displayView):
1327         * UIProcess/API/qt/qwkpage_p.h:
1328         * UIProcess/PageClient.h:
1329         * UIProcess/WebPageProxy.cpp:
1330         (WebKit::WebPageProxy::displayView):
1331         * UIProcess/WebPageProxy.h:
1332         * UIProcess/win/WebView.cpp:
1333         (WebKit::WebView::displayView):
1334         * UIProcess/win/WebView.h:
1335
1336 2011-01-14  Anders Carlsson  <andersca@apple.com>
1337
1338         Reviewed by Sam Weinig.
1339
1340         Implement the "should paint bounds instead of indiviual rects" algorithm from WebKit1
1341         https://bugs.webkit.org/show_bug.cgi?id=52499
1342
1343         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1344         (WebKit::shouldPaintBoundsRect):
1345         Port code from -[WebView _mustDrawUnionedRect:singleRects:count:].
1346
1347         (WebKit::DrawingAreaImpl::display):
1348         If shouldPaintBoundsRect returns true, clear the rects vector and append the bounds rect.
1349
1350 2011-01-14  Brian Weinstein  <bweinstein@apple.com>
1351
1352         Reviewed by Geoff Garen.
1353
1354         ShouldLoadResourceForFrame should use strings, not URLs.
1355         https://bugs.webkit.org/show_bug.cgi?id=52476
1356
1357         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1358         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1359         (WebKit::InjectedBundlePageLoaderClient::shouldLoadResourceForFrame): Pass resourceURL as a string instead of
1360             a URL, and rename from subresourceURL to resourceURL.
1361
1362 2011-01-14  Anders Carlsson  <andersca@apple.com>
1363
1364         Reviewed by Sam Weinig.
1365
1366         Fix for <rdar://problem/8711576> The web process should be able to read resources from the UI process.
1367
1368         Based on a patch by Ivan Krstić. This also makes the NSURLCache path a sandbox parameter.
1369
1370         * Shared/WebProcessCreationParameters.cpp:
1371         (WebKit::WebProcessCreationParameters::encode):
1372         (WebKit::WebProcessCreationParameters::decode):
1373         Encode and decode the uiProcessBundleResourcePath member variable.
1374
1375         * Shared/WebProcessCreationParameters.h:
1376         Add uiProcessBundleResourcePath member variable.
1377
1378         * UIProcess/mac/WebContextMac.mm:
1379         (WebKit::WebContext::platformInitializeWebProcess):
1380         Set the uiProcessBundleResourcePath member variable.
1381
1382         * WebProcess/com.apple.WebProcess.sb:
1383         Allow read-only access to UI_PROCESS_BUNDLE_RESOURCE_DIR and all subdirectories.
1384
1385         * WebProcess/mac/WebProcessMac.mm:
1386         (WebKit::initializeSandbox):
1387         When initializing the sandbox, pass UI_PROCESS_BUNDLE_RESOURCE_DIR.
1388
1389         (WebKit::WebProcess::platformInitializeWebProcess):
1390         Remove the code that would consume a sandbox extension for the url cache path.
1391
1392 2011-01-14  Anders Carlsson  <andersca@apple.com>
1393
1394         Reviewed by Sam Weinig.
1395
1396         Delay initializing the sandbox until we get the InitializeWebProcess message.
1397
1398         * WebProcess/mac/WebProcessMac.mm:
1399         (WebKit::initializeSandbox):
1400         (WebKit::WebProcess::platformInitializeWebProcess):
1401         * WebProcess/mac/WebProcessMainMac.mm:
1402         (WebKit::WebProcessMain):
1403
1404 2011-01-14  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1405
1406         Reviewed by Kenneth Rohde Christiansen.
1407
1408         Align import/export directives
1409         https://bugs.webkit.org/show_bug.cgi?id=52208
1410
1411         * Shared/API/c/WKBase.h: Align import/export directives with
1412         JavaScriptCore/API/JSBase.h.
1413
1414 2011-01-14  Pavel Feldman  <pfeldman@chromium.org>
1415
1416         Reviewed by Yury Semikhatsky.
1417
1418         Web Inspector: extract InspectorSettings from InspectorState, 
1419         simplify it.
1420         https://bugs.webkit.org/show_bug.cgi?id=52429
1421
1422         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1423
1424 2011-01-13  Enrica Casucci  <enrica@apple.com>
1425
1426         Reviewed by Darin Adler.
1427
1428         WebKit2: Add support for drag and drop
1429         https://bugs.webkit.org/show_bug.cgi?id=52343
1430         <rdar://problem/7660558>
1431                
1432         This patch contains the changes required to support dropping content
1433         in WebKit on the Mac. The DragData class has been extended to provide
1434         additional context from the application (keyboard state, modal windows, etc.)
1435         as well as information of the drag pasteboard being used.
1436         The support for WebKit as drag source will be added with a separate patch.
1437
1438         * Shared/DragControllerAction.h: Added.
1439         * UIProcess/API/mac/WKView.mm:
1440         Added implemention of the methods required to add suport for a drop target.
1441         To maintain asynchronous communication with the WebProcess, we always return
1442         the previous calculated value for the drag operation.
1443         (-[WKView _registerDraggedTypes]):
1444         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
1445         (-[WKView applicationFlags:]):
1446         (-[WKView draggingEntered:]):
1447         (-[WKView draggingUpdated:]):
1448         (-[WKView draggingExited:]):
1449         (-[WKView prepareForDragOperation:]):
1450         (-[WKView performDragOperation:]):
1451         * UIProcess/WebPageProxy.cpp:
1452         (WebKit::WebPageProxy::WebPageProxy):
1453         (WebKit::WebPageProxy::performDragControllerAction):
1454         (WebKit::WebPageProxy::didPerformDragControllerAction):
1455         * UIProcess/WebPageProxy.h:
1456         (WebKit::WebPageProxy::dragOperation):
1457         (WebKit::WebPageProxy::resetDragOperation):
1458         * UIProcess/WebPageProxy.messages.in:
1459         * WebKit2.xcodeproj/project.pbxproj:
1460         * WebProcess/WebCoreSupport/WebDragClient.cpp:
1461         (WebKit::WebDragClient::willPerformDragDestinationAction):
1462         (WebKit::WebDragClient::willPerformDragSourceAction):
1463         (WebKit::WebDragClient::actionMaskForDrag):
1464         (WebKit::WebDragClient::dragSourceActionMaskForPoint):
1465         (WebKit::WebDragClient::startDrag):
1466         * WebProcess/WebPage/WebPage.cpp:
1467         (WebKit::WebPage::performDragControllerAction):
1468         * WebProcess/WebPage/WebPage.h:
1469         * WebProcess/WebPage/WebPage.messages.in:
1470
1471 2011-01-13  Dan Bernstein  <mitz@apple.com>
1472
1473         Reviewed by John Sullivan.
1474
1475         Incorrect assertion in DrawingAreaImpl::scroll()
1476         https://bugs.webkit.org/show_bug.cgi?id=52376
1477
1478         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1479         (WebKit::DrawingAreaImpl::scroll): Changed to take the fast path if the rects have the same area.
1480         This made the assertion valid, but I removed it anyway.
1481
1482 2011-01-12  Balazs Kelemen  <kbalazs@webkit.org>
1483
1484         Unreviewed.
1485
1486         Getting rid of the unused 'viewportSize' argument in QWKPagePrivate:init.
1487         The argument is unused since http://trac.webkit.org/changeset/75468.
1488
1489         * UIProcess/API/qt/qgraphicswkview.cpp:
1490         (QGraphicsWKView::QGraphicsWKView):
1491         * UIProcess/API/qt/qwkpage.cpp:
1492         (QWKPagePrivate::init):
1493         * UIProcess/API/qt/qwkpage_p.h:
1494
1495 2011-01-12  Anders Carlsson  <andersca@apple.com>
1496
1497         Reviewed by Sam Weinig.
1498
1499         Implement DrawingAreaImpl::scroll
1500         https://bugs.webkit.org/show_bug.cgi?id=52346
1501
1502         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1503         (WebKit::DrawingAreaImpl::scroll):
1504         If there is already an active scroll, compute the area of both scroll rects and
1505         invalidate the smallest one. Compute a new dirty region if necessary and also
1506         add the scroll repaint region to the dirty region.
1507
1508         (WebKit::DrawingAreaImpl::display):
1509         Reset the scroll area and scroll delta.
1510
1511         * WebProcess/WebPage/DrawingAreaImpl.h:
1512         Add scroll area and scroll delta member variables.
1513
1514 2011-01-12  Anders Carlsson  <andersca@apple.com>
1515
1516         Reviewed by Dan Bernstein.
1517
1518         Region improvements
1519         https://bugs.webkit.org/show_bug.cgi?id=52344
1520
1521         * Platform/Region.cpp:
1522         (WebKit::Region::Shape::move):
1523         (WebKit::Region::move):
1524         Change Region::move to take an IntSize.
1525
1526         * Platform/Region.h:
1527         (WebKit::intersect):
1528         (WebKit::subtract):
1529         (WebKit::move):
1530         Add convenience functions.
1531
1532 2011-01-12  Ryosuke Niwa  <rniwa@webkit.org>
1533
1534         Unreviewed Qt build fix for r75661
1535
1536         * Shared/WebEvent.h: Don't declare phase() on non-Mac platforms.
1537
1538 2011-01-12  Beth Dakin  <bdakin@apple.com>
1539
1540         Reviewed by Anders Carlsson.
1541
1542         Add-on for https://bugs.webkit.org/show_bug.cgi?id=52309 
1543         Expose fixed layout through WebKit SPI
1544         -and corresponding-
1545         <rdar://problem/8844464>
1546
1547         And now with getters!
1548         * UIProcess/API/C/WKPage.cpp:
1549         (WKPageUseFixedLayout):
1550         (WKPageFixedLayoutSize):
1551         * UIProcess/API/C/WKPage.h:
1552         * UIProcess/WebPageProxy.h:
1553         (WebKit::WebPageProxy::useFixedLayout):
1554         (WebKit::WebPageProxy::fixedLayoutSize):
1555
1556 2011-01-12  Sam Weinig  <sam@webkit.org>
1557
1558         Reviewed by Anders Carlsson.
1559
1560         https://bugs.webkit.org/show_bug.cgi?id=52337
1561         PlatformWheelEvent should know about the scroll phase on the Mac
1562
1563         Add a phase parameter on Mac WebWheelEvent and pipe it down to PlatformWheelEvent.
1564
1565         * Shared/WebEvent.h:
1566         (WebKit::WebWheelEvent::phase):
1567         * Shared/WebEventConversion.cpp:
1568         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
1569         * Shared/WebWheelEvent.cpp:
1570         (WebKit::WebWheelEvent::WebWheelEvent):
1571         (WebKit::WebWheelEvent::encode):
1572         (WebKit::WebWheelEvent::decode):
1573         * Shared/mac/WebEventFactory.mm:
1574         (WebKit::phaseForEvent):
1575         (WebKit::WebEventFactory::createWebWheelEvent):
1576
1577 2011-01-12  Anders Carlsson  <andersca@apple.com>
1578
1579         Reviewed by Sam Weinig.
1580
1581         Get rid of an unneeded parameter from DrawingArea::scroll
1582         https://bugs.webkit.org/show_bug.cgi?id=52336
1583
1584         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1585         (WebKit::WebChromeClient::scroll):
1586         * WebProcess/WebCoreSupport/WebChromeClient.h:
1587         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
1588         (WebKit::ChunkedUpdateDrawingArea::scroll):
1589         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
1590         * WebProcess/WebPage/DrawingArea.h:
1591         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1592         (WebKit::DrawingAreaImpl::scroll):
1593         * WebProcess/WebPage/DrawingAreaImpl.h:
1594         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
1595         (WebKit::LayerBackedDrawingArea::scroll):
1596         * WebProcess/WebPage/LayerBackedDrawingArea.h:
1597         * WebProcess/WebPage/TiledDrawingArea.cpp:
1598         (WebKit::TiledDrawingArea::scroll):
1599         * WebProcess/WebPage/TiledDrawingArea.h:
1600
1601 2011-01-12  Anders Carlsson  <andersca@apple.com>
1602
1603         Reviewed by Sam Weinig.
1604
1605         Get the new drawing area painting to the screen
1606         https://bugs.webkit.org/show_bug.cgi?id=52331
1607
1608         * UIProcess/DrawingAreaProxyImpl.cpp:
1609         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
1610         Call setViewNeedsDisplay on all the update rects.
1611
1612         * UIProcess/WebPageProxy.cpp:
1613         (WebKit::WebPageProxy::setViewNeedsDisplay):
1614         Call through to the page client.
1615
1616         (WebKit::WebPageProxy::processDidCrash):
1617         Null out the drawing area proxy.
1618         
1619         * UIProcess/mac/BackingStoreMac.mm:
1620         (WebKit::BackingStore::paint):
1621         Paint.
1622
1623 2011-01-12  Anders Carlsson  <andersca@apple.com>
1624
1625         Reviewed by Sam Weinig.
1626
1627         More work on getting the drawing area proxy to paint
1628         https://bugs.webkit.org/show_bug.cgi?id=52328
1629
1630         * UIProcess/API/mac/WKView.mm:
1631         (-[WKView drawRect:]):
1632         Handle the new drawing area.
1633
1634         * UIProcess/BackingStore.cpp:
1635         (WebKit::BackingStore::BackingStore):
1636         Assert that the size isn't empty.
1637         
1638         * UIProcess/BackingStore.h:
1639         * UIProcess/mac/BackingStoreMac.mm:
1640         (WebKit::BackingStore::incorporateUpdate):
1641         Paint all update rects into the bitmap context.
1642
1643         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1644         (WebKit::DrawingAreaImpl::display):
1645         Create a handle so the shareable bitmap will actually be transferred over.
1646
1647 2011-01-12  Anders Carlsson  <andersca@apple.com>
1648
1649         Fix build.
1650
1651         * UIProcess/DrawingAreaProxyImpl.cpp:
1652         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
1653
1654 2011-01-12  Anders Carlsson  <andersca@apple.com>
1655
1656         Reviewed by Sam Weinig.
1657
1658         Begin stubbing out some more BackingStore member functions
1659         https://bugs.webkit.org/show_bug.cgi?id=52323
1660
1661         * UIProcess/BackingStore.cpp:
1662         (WebKit::BackingStore::~BackingStore):
1663         This was accidentally made into a constructor; it should be a destructor.
1664
1665         * UIProcess/DrawingAreaProxyImpl.cpp:
1666         (WebKit::DrawingAreaProxyImpl::paint):
1667         Call the backing store.
1668
1669         (WebKit::DrawingAreaProxyImpl::update):
1670         Incorporate the update.
1671
1672         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
1673         Create the backing store if needed and incorporate the update.
1674
1675         * UIProcess/mac/BackingStoreMac.mm: Added.
1676         (WebKit::BackingStore::platformInitialize):
1677         Create a bitmap context.
1678
1679         (WebKit::BackingStore::paint):
1680         (WebKit::BackingStore::incorporateUpdate):
1681         Add stubs.
1682
1683         * WebKit2.xcodeproj/project.pbxproj:
1684         Add BackingStoreMac.mm
1685
1686 2011-01-12  Beth Dakin  <bdakin@apple.com>
1687
1688         Reviewed by Anders Carlsson.
1689
1690         Fix for https://bugs.webkit.org/show_bug.cgi?id=52309 Expose
1691         fixed layout through WebKit SPI
1692         -and corresponding-
1693         <rdar://problem/8844464>
1694
1695         Store useFixedLayout and fixedLayoutSize in the 
1696         WebPageCreationParameters and the WebPageProxy.
1697         * Shared/WebPageCreationParameters.cpp:
1698         (WebKit::WebPageCreationParameters::encode):
1699         (WebKit::WebPageCreationParameters::decode):
1700         * Shared/WebPageCreationParameters.h:
1701         * UIProcess/API/C/WKPage.cpp:
1702         (WKPageSetUseFixedLayout):
1703         (WKPageSetFixedLayoutSize):
1704         * UIProcess/API/C/WKPage.h:
1705         * UIProcess/WebPageProxy.cpp:
1706         (WebKit::WebPageProxy::WebPageProxy):
1707         (WebKit::WebPageProxy::setUseFixedLayout):
1708         (WebKit::WebPageProxy::setFixedLayoutSize):
1709         (WebKit::WebPageProxy::creationParameters):
1710         * UIProcess/WebPageProxy.h:
1711         * WebProcess/WebPage/WebPage.cpp:
1712         (WebKit::WebPage::setUseFixedLayout):
1713         (WebKit::WebPage::setFixedLayoutSize):
1714         * WebProcess/WebPage/WebPage.h:
1715         * WebProcess/WebPage/WebPage.messages.in:
1716
1717 2011-01-12  Anders Carlsson  <andersca@apple.com>
1718
1719         Reviewed by Beth Dakin.
1720
1721         Add BackingStore class
1722         https://bugs.webkit.org/show_bug.cgi?id=52318
1723
1724         * UIProcess/BackingStore.cpp: Added.
1725         (WebKit::BackingStore::create):
1726         (WebKit::BackingStore::BackingStore):
1727         * UIProcess/BackingStore.h: Added.
1728         * WebKit2.xcodeproj/project.pbxproj:
1729
1730 2011-01-12  Brady Eidson  <beidson@apple.com>
1731
1732         Reviewed by Sam Weinig.
1733
1734         <rdar://problem/8837307>, <rdar://problem/8637038>, and https://bugs.webkit.org/show_bug.cgi?id=52248
1735         Back/forward list recovery after a WebProcess crash is crashy itself.
1736
1737         Add an isEmpty() accessor so the WebProcess knows if it is actually restoring a session:
1738         * Shared/SessionState.cpp:
1739         (WebKit::SessionState::isEmpty):
1740         * Shared/SessionState.h:
1741
1742         Keep track of the highest used itemID so a relaunched WebProcess can later be informed:
1743         * Shared/WebBackForwardListItem.cpp:
1744         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1745         (WebKit::WebBackForwardListItem::highedUsedItemID):
1746         * Shared/WebBackForwardListItem.h:
1747         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1748         (WebKit::generateHistoryItemID):
1749         (WebKit::WebBackForwardListProxy::setHighestItemIDFromUIProcess):
1750         (WebKit::WebBackForwardListProxy::addItemFromUIProcess): Remove a now-invalid ASSERT, as the UIProcess
1751           now tells the WebProcess that a previous WebProcess created.
1752         * WebProcess/WebPage/WebBackForwardListProxy.h:
1753
1754         Encode/decode data relevant to restoring a session on WebPage creation:
1755         * Shared/WebPageCreationParameters.cpp:
1756         (WebKit::WebPageCreationParameters::encode):
1757         (WebKit::WebPageCreationParameters::decode):
1758         * Shared/WebPageCreationParameters.h:
1759
1760         If the WebProcess has crashed since the last load, change reload and the various back/forward APIs to 
1761         update the current back/forward item (if necessary) then relaunch the process:
1762         * UIProcess/WebPageProxy.cpp:
1763         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1764         (WebKit::WebPageProxy::reattachToWebProcess): Renamed from "relaunch()" and made private.
1765         (WebKit::WebPageProxy::initializeWebPage):
1766         (WebKit::WebPageProxy::loadURL):
1767         (WebKit::WebPageProxy::loadURLRequest):
1768         (WebKit::WebPageProxy::reload):
1769         (WebKit::WebPageProxy::goForward):
1770         (WebKit::WebPageProxy::goBack):
1771         (WebKit::WebPageProxy::goToBackForwardItem):
1772         (WebKit::WebPageProxy::creationParameters):
1773         * UIProcess/WebPageProxy.h:
1774
1775         Rename "RestoreSession" to "RestoreSessionAndNavigateToCurrentItem"
1776         * WebProcess/WebPage/WebPage.messages.in:
1777         * UIProcess/cf/WebPageProxyCF.cpp:
1778         (WebKit::WebPageProxy::restoreFromSessionStateData):
1779
1780         Restore a session on page creation if the parameters include it:
1781         * WebProcess/WebPage/WebPage.cpp:
1782         (WebKit::WebPage::WebPage): Call restoreSession if session state exists.
1783         (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem):
1784         (WebKit::WebPage::restoreSession):
1785         * WebProcess/WebPage/WebPage.h:
1786
1787 2011-01-12  Anders Carlsson  <andersca@apple.com>
1788
1789         Reviewed by Sam Weinig.
1790
1791         Send Update and DidUpdate messages
1792         https://bugs.webkit.org/show_bug.cgi?id=52316
1793
1794         * UIProcess/DrawingAreaProxy.h:
1795         (WebKit::DrawingAreaProxy::update):
1796         Add empty stub.
1797
1798         * UIProcess/DrawingAreaProxy.messages.in:
1799         Add Update message.
1800
1801         * UIProcess/DrawingAreaProxyImpl.cpp:
1802         (WebKit::DrawingAreaProxyImpl::update):
1803         Just send back a DidUpdate message.
1804
1805         * WebProcess/WebPage/DrawingArea.h:
1806         (WebKit::DrawingArea::didUpdate):
1807         Add empty stub.
1808
1809         * WebProcess/WebPage/DrawingArea.messages.in:
1810         Add DidUpdate message.
1811
1812         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1813         (WebKit::DrawingAreaImpl::didUpdate):
1814         Call display().
1815
1816         (WebKit::DrawingAreaImpl::display):
1817         Send an Update message.
1818
1819 2011-01-12  Anders Carlsson  <andersca@apple.com>
1820
1821         Reviewed by Sam Weinig.
1822
1823         Make the new drawing area actually draw something
1824         https://bugs.webkit.org/show_bug.cgi?id=52314
1825
1826         * Shared/UpdateInfo.cpp:
1827         (WebKit::UpdateInfo::encode):
1828         (WebKit::UpdateInfo::decode):
1829         Encode and decode newly added fields.
1830
1831         * Shared/UpdateInfo.h:
1832         Add a vector of update rects and a handle for the sharable bitmap.
1833
1834         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1835         (WebKit::DrawingAreaImpl::display):
1836         Get the individual rects from the region and paint them into the shareable bitmap.
1837
1838         * WebProcess/WebPage/WebPage.cpp:
1839         (WebKit::WebPage::mainFrameHasCustomRepresentation):
1840         * WebProcess/WebPage/WebPage.h:
1841         Add helper function.
1842
1843         * WebProcess/WebPage/mac/ChunkedUpdateDrawingAreaMac.cpp:
1844         (WebKit::ChunkedUpdateDrawingArea::paintIntoUpdateChunk):
1845         Use helper function.
1846
1847 2011-01-12  Anders Carlsson  <andersca@apple.com>
1848
1849         Reviewed by Sam Weinig.
1850
1851         Add UpdateInfo class
1852         https://bugs.webkit.org/show_bug.cgi?id=52306
1853
1854         * Shared/UpdateInfo.cpp: Added.
1855         (WebKit::UpdateInfo::encode):
1856         (WebKit::UpdateInfo::decode):
1857         * Shared/UpdateInfo.h: Added.
1858         (WebKit::UpdateInfo::UpdateInfo):
1859         * WebKit2.xcodeproj/project.pbxproj:
1860
1861 2011-01-12  Anders Carlsson  <andersca@apple.com>
1862
1863         Reviewed by Sam Weinig.
1864
1865         More work on the new drawing area implementation
1866         https://bugs.webkit.org/show_bug.cgi?id=52302
1867
1868         * Platform/Region.cpp:
1869         (WebKit::Region::Shape::segments_end):
1870         segments_end could end up returning an iterator that is one element past the Vector data, so
1871         we can't use operator[] since that will assert.
1872
1873         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1874         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
1875         Initialize the timer.
1876
1877         (WebKit::DrawingAreaImpl::setNeedsDisplay):
1878         Unite the rect with the dirty region and schedule a display.
1879
1880         (WebKit::DrawingAreaImpl::setSize):
1881         Tell the web page to resize.
1882
1883         (WebKit::DrawingAreaImpl::scheduleDisplay):
1884         Start a display timer if needed.
1885
1886         (WebKit::DrawingAreaImpl::display):
1887         Add a stub.
1888
1889 2011-01-12  Brent Fulgham  <bfulgham@webkit.org>
1890
1891         Unreviewed build fix after r75527.  Rename 'BackingStoreCairo.cpp'
1892         to 'ShareableBitmapCairo.cpp' to match VS project changes.
1893
1894         * Shared/cairo/BackingStoreCairo.cpp: Removed.
1895         * Shared/cairo/ShareableBitmapCairo.cpp: Copied from Shared/cairo/BackingStoreCairo.cpp.
1896
1897 2011-01-11  Jeff Miller  <jeffm@apple.com>
1898
1899         Reviewed by John Sullivan.
1900
1901         WebKit2: "Webpages not responding" dialog appears when <select> popup menu is showing
1902         https://bugs.webkit.org/show_bug.cgi?id=52242
1903
1904         * UIProcess/WebPageProxy.cpp:
1905         (WebKit::WebPageProxy::showPopupMenu):
1906         On Windows, stop the responsiveness timer before calling showPopupMenu().
1907
1908 2011-01-11  Maciej Stachowiak  <mjs@apple.com>
1909
1910         Reviewed by Anders Carlsson.
1911
1912         UIProcess kills the WebProcess sometimes when detached frames exist
1913         https://bugs.webkit.org/show_bug.cgi?id=52227
1914
1915         * UIProcess/WebPageProxy.cpp:
1916         (WebKit::WebPageProxy::didSaveFrameToPageCache): Don't consider the message invalid
1917         if it came in for a detached frame.
1918
1919 2011-01-11  Anders Carlsson  <andersca@apple.com>
1920
1921         Build fix.
1922
1923         * WebKit2.xcodeproj/project.pbxproj:
1924
1925 2011-01-11  Anders Carlsson  <andersca@apple.com>
1926
1927         Reviewed by Sam Weinig.
1928
1929         Add a Region class which represents a graphical region
1930         https://bugs.webkit.org/show_bug.cgi?id=52255
1931
1932         * Platform/Region.cpp: Added.
1933         (WebKit::Region::Region):
1934         (WebKit::Region::rects):
1935         (WebKit::Region::Shape::Shape):
1936         (WebKit::Region::Shape::appendSpan):
1937         (WebKit::Region::Shape::canCoalesce):
1938         (WebKit::Region::Shape::appendSpans):
1939         (WebKit::Region::Shape::appendSegment):
1940         (WebKit::Region::Shape::spans_begin):
1941         (WebKit::Region::Shape::spans_end):
1942         (WebKit::Region::Shape::segments_begin):
1943         (WebKit::Region::Shape::segments_end):
1944         (WebKit::Region::Shape::dump):
1945         (WebKit::Region::Shape::bounds):
1946         (WebKit::Region::Shape::move):
1947         (WebKit::Region::Shape::swap):
1948         (WebKit::Region::Shape::shapeOperation):
1949         (WebKit::Region::Shape::UnionOperation::trySimpleOperation):
1950         (WebKit::Region::Shape::unionShapes):
1951         (WebKit::Region::Shape::IntersectOperation::trySimpleOperation):
1952         (WebKit::Region::Shape::intersectShapes):
1953         (WebKit::Region::Shape::SubtractOperation::trySimpleOperation):
1954         (WebKit::Region::Shape::subtractShapes):
1955         (WebKit::Region::dump):
1956         (WebKit::Region::intersect):
1957         (WebKit::Region::unite):
1958         (WebKit::Region::subtract):
1959         (WebKit::Region::move):
1960         * Platform/Region.h: Added.
1961         (WebKit::Region::bounds):
1962         (WebKit::Region::isEmpty):
1963         (WebKit::Region::Span::Span):
1964         (WebKit::Region::Shape::isEmpty):
1965         * WebKit2.xcodeproj/project.pbxproj:
1966
1967 2011-01-11  Anders Carlsson  <andersca@apple.com>
1968
1969         Reviewed by Darin Adler.
1970
1971         Add DidSetSize message
1972         https://bugs.webkit.org/show_bug.cgi?id=52254
1973
1974         * DerivedSources.make:
1975         Add DrawingAReaProxy.messages.in.
1976
1977         * Platform/CoreIPC/MessageID.h:
1978         Add DrawingAreaProxy message class.
1979
1980         * UIProcess/DrawingAreaProxy.h:
1981         (WebKit::DrawingAreaProxy::didSetSize):
1982         Add CoreIPC message handler function.
1983
1984         * UIProcess/DrawingAreaProxy.messages.in: Added.
1985
1986         * UIProcess/DrawingAreaProxyImpl.cpp:
1987         (WebKit::DrawingAreaProxyImpl::didSetSize):
1988         Add stub.
1989
1990         * UIProcess/WebPageProxy.cpp:
1991         (WebKit::WebPageProxy::didReceiveMessage):
1992         Handle DrawingAreaProxy messages.
1993
1994         * WebKit2.xcodeproj/project.pbxproj:
1995         Add new files.
1996
1997         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1998         (WebKit::DrawingAreaImpl::setSize):
1999         Send a DidSetSize message for now.
2000
2001 2011-01-11  Sam Weinig  <sam@webkit.org>
2002
2003         Reviewed by Anders Carlsson.
2004
2005         Fix spelling mistake. Sharable -> Shareable.
2006
2007         * Shared/API/c/WKImage.h:
2008         * Shared/API/c/WKSharedAPICast.h:
2009         (WebKit::toImageOptions):
2010         * Shared/ImageOptions.h:
2011         * Shared/WebImage.cpp:
2012         (WebKit::WebImage::create):
2013
2014 2011-01-11  Anders Carlsson  <andersca@apple.com>
2015
2016         Reviewed by Sam Weinig.
2017
2018         Add SetSize message
2019         https://bugs.webkit.org/show_bug.cgi?id=52247
2020
2021         * DerivedSources.make:
2022         Add DrawingArea.messages.in
2023
2024         * Platform/CoreIPC/MessageID.h:
2025         Add DrawingArea message class.
2026
2027         * UIProcess/DrawingAreaProxyImpl.cpp:
2028         (WebKit::DrawingAreaProxyImpl::sizeDidChange):
2029         Call sendSetSize.
2030
2031         (WebKit::DrawingAreaProxyImpl::sendSetSize):
2032         Send a SetSize message.
2033
2034         * UIProcess/DrawingAreaProxyImpl.h:
2035         Add setSize override.
2036
2037         * WebKit2.xcodeproj/project.pbxproj:
2038         Add new files.
2039
2040         * WebProcess/WebPage/DrawingArea.h:
2041         (WebKit::DrawingArea::setSize):
2042         Add setSize member function.
2043
2044         * WebProcess/WebPage/DrawingArea.messages.in: Added.
2045
2046         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2047         * WebProcess/WebPage/DrawingAreaImpl.h:
2048         Add setSize.
2049
2050         * WebProcess/WebPage/WebPage.cpp:
2051         (WebKit::WebPage::didReceiveMessage):
2052         Handle drawing area messages.
2053
2054 2011-01-11  Anders Carlsson  <andersca@apple.com>
2055
2056         Reviewed by Sam Weinig.
2057
2058         Replace ASSERTs with FIXMEs.
2059
2060         * UIProcess/DrawingAreaProxyImpl.cpp:
2061         (WebKit::DrawingAreaProxyImpl::sizeDidChange):
2062         (WebKit::DrawingAreaProxyImpl::setPageIsVisible):
2063
2064 2011-01-11  Anders Carlsson  <andersca@apple.com>
2065
2066         Reviewed by Sam Weinig.
2067
2068         Add DrawingAreaImpl skeleton class
2069         https://bugs.webkit.org/show_bug.cgi?id=52246
2070
2071         * UIProcess/API/mac/WKView.mm:
2072         (useNewDrawingArea):
2073         New function which controls which drawing area to use, through an environment variable.
2074
2075         (-[WKView drawRect:]):
2076         Bail if we're using the new drawing area (for now).
2077
2078         (-[WKView WebKit::]):
2079         Create a DrawingAreaProxyImpl when asked to.
2080
2081         * WebKit2.xcodeproj/project.pbxproj:
2082         Add new files.
2083
2084         * WebProcess/WebPage/DrawingArea.cpp:
2085         (WebKit::DrawingArea::create):
2086         Create a DrawingAreaImpl when asked to.
2087
2088         * WebProcess/WebPage/DrawingAreaImpl.cpp: Added.
2089         * WebProcess/WebPage/DrawingAreaImpl.h: Added.
2090         Add DrawingAreaImpl class.
2091
2092 2011-01-11  Anders Carlsson  <andersca@apple.com>
2093
2094         Reviewed by Sam Weinig.
2095
2096         Add Mac-only DrawingAreaProxyImpl class skeleton
2097         https://bugs.webkit.org/show_bug.cgi?id=52243
2098
2099         This is the proxy side of a new drawing area implementation. This is Mac only for now
2100         while the design is being fleshed out.
2101
2102         * Shared/DrawingAreaInfo.h:
2103         * UIProcess/API/mac/WKView.mm:
2104         (-[WKView _switchToDrawingAreaTypeIfNecessary:DrawingAreaInfo::]):
2105         * UIProcess/DrawingAreaProxyImpl.cpp: Added.
2106         (WebKit::DrawingAreaProxyImpl::create):
2107         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
2108         (WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl):
2109         (WebKit::DrawingAreaProxyImpl::didReceiveMessage):
2110         (WebKit::DrawingAreaProxyImpl::didReceiveSyncMessage):
2111         (WebKit::DrawingAreaProxyImpl::paint):
2112         (WebKit::DrawingAreaProxyImpl::sizeDidChange):
2113         (WebKit::DrawingAreaProxyImpl::setPageIsVisible):
2114         (WebKit::DrawingAreaProxyImpl::attachCompositingContext):
2115         (WebKit::DrawingAreaProxyImpl::detachCompositingContext):
2116         * UIProcess/DrawingAreaProxyImpl.h: Added.
2117         * WebKit2.xcodeproj/project.pbxproj:
2118         * WebProcess/WebPage/DrawingArea.cpp:
2119         (WebKit::DrawingArea::create):
2120
2121 2011-01-11  Anders Carlsson  <andersca@apple.com>
2122
2123         Fix Windows build.
2124
2125         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
2126         (WebKit::WebPopupMenu::setUpPlatformData):
2127
2128 2011-01-11  Anders Carlsson  <andersca@apple.com>
2129
2130         Reviewed by Sam Weinig.
2131
2132         Rename ShareableBitmap::createSharable to createShareable
2133         https://bugs.webkit.org/show_bug.cgi?id=52234
2134
2135         * Shared/ShareableBitmap.cpp:
2136         (WebKit::ShareableBitmap::createShareable):
2137         * Shared/ShareableBitmap.h:
2138         * Shared/WebImage.cpp:
2139         (WebKit::WebImage::create):
2140         * WebProcess/Plugins/PluginProxy.cpp:
2141         (WebKit::PluginProxy::geometryDidChange):
2142         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
2143         (WebKit::WebPopupMenu::setUpPlatformData):
2144         * WebProcess/WebPage/FindController.cpp:
2145         (WebKit::FindController::updateFindIndicator):
2146
2147 2011-01-11  Anders Carlsson  <andersca@apple.com>
2148
2149         Reviewed by Sam Weinig.
2150
2151         Rename BackingStore to ShareableBitmap
2152         https://bugs.webkit.org/show_bug.cgi?id=52228
2153
2154         * GNUmakefile.am:
2155         * PluginProcess/PluginControllerProxy.cpp:
2156         (WebKit::PluginControllerProxy::geometryDidChange):
2157         * PluginProcess/PluginControllerProxy.h:
2158         * Shared/API/c/cg/WKImageCG.cpp:
2159         (WKImageCreateCGImage):
2160         * Shared/BackingStore.cpp: Removed.
2161         * Shared/BackingStore.h: Removed.
2162         * Shared/PlatformPopupMenuData.cpp:
2163         (WebKit::PlatformPopupMenuData::decode):
2164         * Shared/PlatformPopupMenuData.h:
2165         * Shared/ShareableBitmap.cpp: Copied from WebKit2/Shared/BackingStore.cpp.
2166         (WebKit::ShareableBitmap::create):
2167         (WebKit::ShareableBitmap::createSharable):
2168         (WebKit::ShareableBitmap::createHandle):
2169         (WebKit::ShareableBitmap::ShareableBitmap):
2170         (WebKit::ShareableBitmap::~ShareableBitmap):
2171         (WebKit::ShareableBitmap::resize):
2172         (WebKit::ShareableBitmap::data):
2173         * Shared/ShareableBitmap.h: Copied from WebKit2/Shared/BackingStore.h.
2174         * Shared/UserMessageCoders.h:
2175         (WebKit::UserMessageEncoder::baseEncode):
2176         (WebKit::UserMessageDecoder::baseDecode):
2177         * Shared/WebImage.cpp:
2178         (WebKit::WebImage::create):
2179         (WebKit::WebImage::WebImage):
2180         (WebKit::WebImage::~WebImage):
2181         (WebKit::WebImage::size):
2182         * Shared/WebImage.h:
2183         (WebKit::WebImage::bitmap):
2184         * Shared/cairo/BackingStoreCairo.cpp:
2185         (WebKit::ShareableBitmap::createGraphicsContext):
2186         (WebKit::ShareableBitmap::paint):
2187         * Shared/cg/BackingStoreCG.cpp: Removed.
2188         * Shared/cg/ShareableBitmapCG.cpp: Copied from WebKit2/Shared/cg/BackingStoreCG.cpp.
2189         (WebKit::ShareableBitmap::createGraphicsContext):
2190         (WebKit::ShareableBitmap::paint):
2191         * Shared/gtk/BackingStoreGtk.cpp: Removed.
2192         * Shared/gtk/ShareableBitmapGtk.cpp: Copied from WebKit2/Shared/gtk/BackingStoreGtk.cpp.
2193         (WebKit::ShareableBitmap::createGraphicsContext):
2194         (WebKit::ShareableBitmap::paint):
2195         * Shared/qt/BackingStoreQt.cpp: Removed.
2196         * Shared/qt/ShareableBitmapQt.cpp: Copied from WebKit2/Shared/qt/BackingStoreQt.cpp.
2197         (WebKit::ShareableBitmap::createGraphicsContext):
2198         (WebKit::ShareableBitmap::paint):
2199         * UIProcess/FindIndicator.cpp:
2200         (WebKit::FindIndicator::create):
2201         (WebKit::FindIndicator::FindIndicator):
2202         * UIProcess/FindIndicator.h:
2203         (WebKit::FindIndicator::contentImage):
2204         * WebKit2.pro:
2205         * WebKit2.xcodeproj/project.pbxproj:
2206         * WebProcess/Plugins/PluginProxy.cpp:
2207         (WebKit::PluginProxy::geometryDidChange):
2208         * WebProcess/Plugins/PluginProxy.h:
2209         * WebProcess/WebPage/FindController.cpp:
2210         (WebKit::FindController::updateFindIndicator):
2211         * WebProcess/WebPage/WebPage.cpp:
2212         (WebKit::WebPage::snapshotInViewCoordinates):
2213         (WebKit::WebPage::snapshotInDocumentCoordinates):
2214         * win/WebKit2.vcproj:
2215
2216 2011-01-11  John Sullivan  <sullivan@apple.com>
2217
2218         Reviewed by Anders Carlsson.
2219
2220         [WKView setFrameSize:] derefs _page->drawingArea() without null check
2221         <https://bugs.webkit.org/show_bug.cgi?id=52231>
2222
2223         * UIProcess/API/mac/WKView.mm:
2224         (-[WKView setFrameSize:]):
2225         Null check drawingArea(). This is OK because if it doesn't exist then it will be
2226         created later with the correct initial size.
2227
2228 2011-01-07  Enrica Casucci  <enrica@apple.com>
2229
2230         Reviewed by Alexey Proskuryakov.
2231
2232         Paste and drag and drop use different code paths to interact with the pasteboard.
2233         https://bugs.webkit.org/show_bug.cgi?id=52093
2234         The change consists in a refactoring of the code to have only one class that
2235         deals with the pasteboard on Mac.
2236
2237         * WebProcess/WebCoreSupport/WebEditorClient.h:
2238         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: Added two methods to provide to WebCore functionality
2239         exposed by NSURLExtras.
2240         (WebKit::WebEditorClient::canonicalizeURL):
2241         (WebKit::WebEditorClient::canonicalizeURLString):
2242
2243 2011-01-11  Jessie Berlin  <jberlin@apple.com>
2244
2245         Reviewed by Anders Carlsson and Sam Weinig.
2246
2247         Fix crash on launch on Windows.
2248
2249         * UIProcess/win/WebView.cpp:
2250         (WebKit::WebView::onSizeEvent):
2251         The drawing area is no longer initialized before the WebView is created and the first
2252         onSize is receieved.
2253
2254 2011-01-11  Anders Carlsson  <andersca@apple.com>
2255
2256         Reviewed by Dan Bernstein.
2257
2258         Automatically reinitialize the web page on relaunch
2259         https://bugs.webkit.org/show_bug.cgi?id=52224
2260         <rdar://problem/8765695>
2261
2262         * UIProcess/API/mac/WKView.mm:
2263         (-[WKView _didRelaunchProcess]):
2264         Remove call to reinitializeWebPage.
2265
2266         * UIProcess/WebPageProxy.cpp:
2267         (WebKit::WebPageProxy::relaunch):
2268         Call initializeWebPage().
2269
2270         (WebKit::WebPageProxy::initializeWebPage):
2271         Assert that the web page is valid here.
2272
2273         * UIProcess/WebPageProxy.h:
2274         Remove reinitializeWebPage.
2275
2276         * UIProcess/win/WebView.cpp:
2277         (WebKit::WebView::didRelaunchProcess):
2278         Remove call to reinitializeWebPage.
2279
2280 2011-01-10  Anders Carlsson  <andersca@apple.com>
2281
2282         Reviewed by Sam Weinig.
2283
2284         Pass the view size to the DrawingAreaProxy constructor
2285         https://bugs.webkit.org/show_bug.cgi?id=52189
2286
2287         * UIProcess/DrawingAreaProxy.cpp:
2288         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2289         * UIProcess/WebPageProxy.cpp:
2290         (WebKit::WebPageProxy::viewSize):
2291         * UIProcess/WebPageProxy.h:
2292
2293 2011-01-11  Sam Weinig  <sam@webkit.org>
2294
2295         Roll r75460 back in with build fix.
2296
2297 2011-01-11  Anders Carlsson  <andersca@apple.com>
2298
2299         Reviewed by Andreas Kling.
2300
2301         Work towards having the WebPageProxy decide when to create the DrawingAreaProxy
2302         https://bugs.webkit.org/show_bug.cgi?id=52184
2303
2304         Qt part made my Balazs Kelemen.
2305
2306         * UIProcess/API/mac/PageClientImpl.h:
2307         * UIProcess/API/mac/PageClientImpl.mm:
2308         (WebKit::PageClientImpl::createDrawingAreaProxy):
2309         Call -[WKView _createDrawingAreaProxy].
2310
2311         (WebKit::PageClientImpl::setViewNeedsDisplay):
2312         Call setNeedsDisplayInRect on the WKView.
2313
2314         * UIProcess/API/mac/WKView.mm:
2315         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
2316         No need to set the drawing area proxy anymore.
2317
2318         (-[WKView _createDrawingAreaProxy]):
2319         Create a chunked update drawing area proxy for now.
2320
2321         * UIProcess/API/qt/qgraphicswkview.cpp:
2322         Added a QGraphicsItem* member that is initialized in init to the accociated view.
2323         Implement the new functions. This is a temporary solution, in the long term the view
2324         and the page should be decoupled.
2325         (QGraphicsWKView::QGraphicsWKView):
2326         * UIProcess/API/qt/qwkpage.cpp:
2327         (QWKPagePrivate::QWKPagePrivate):
2328         (QWKPagePrivate::init):
2329         (QWKPagePrivate::createDrawingAreaProxy):
2330         (QWKPagePrivate::setViewNeedsDisplay):
2331         * UIProcess/API/qt/qwkpage.h:
2332         * UIProcess/API/qt/qwkpage_p.h:
2333         
2334         * UIProcess/PageClient.h:
2335         Add new pure virtual member functions.
2336
2337         * UIProcess/WebPageProxy.cpp:
2338         (WebKit::WebPageProxy::initializeWebPage):
2339         (WebKit::WebPageProxy::reinitializeWebPage):
2340         Set the new drawing area proxy.
2341
2342         * UIProcess/win/WebView.cpp:
2343         (WebKit::WebView::WebView):
2344         No need to set the drawing area proxy anymore.
2345
2346         (WebKit::WebView::createDrawingAreaProxy):
2347         Create a chunked update drawing area proxy for now.
2348
2349         (WebKit::WebView::setViewNeedsDisplay):
2350         Invalidate the window.
2351
2352 2011-01-11  Adam Roben  <aroben@apple.com>
2353
2354         Fix a typo in a comment
2355
2356         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2357
2358 2011-01-10  Sheriff Bot  <webkit.review.bot@gmail.com>
2359
2360         Unreviewed, rolling out r75460.
2361         http://trac.webkit.org/changeset/75460
2362         https://bugs.webkit.org/show_bug.cgi?id=52191
2363
2364         It broke Qt-WK2 build (Requested by Ossy on #webkit).
2365
2366         * Shared/API/c/WKBase.h:
2367         * Shared/APIObject.h:
2368         * UIProcess/API/C/WKAPICast.h:
2369         * UIProcess/API/C/WKGeolocationPermissionRequest.cpp: Removed.
2370         * UIProcess/API/C/WKGeolocationPermissionRequest.h: Removed.
2371         * UIProcess/API/C/WKPage.h:
2372         * UIProcess/API/C/WebKit2.h:
2373         * UIProcess/API/qt/qwkpage.cpp:
2374         (QWKPage::QWKPage):
2375         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: Removed.
2376         * UIProcess/GeolocationPermissionRequestManagerProxy.h: Removed.
2377         * UIProcess/GeolocationPermissionRequestProxy.cpp: Removed.
2378         * UIProcess/GeolocationPermissionRequestProxy.h: Removed.
2379         * UIProcess/WebPageProxy.cpp:
2380         (WebKit::WebPageProxy::WebPageProxy):
2381         (WebKit::WebPageProxy::close):
2382         (WebKit::WebPageProxy::processDidCrash):
2383         * UIProcess/WebPageProxy.h:
2384         * UIProcess/WebPageProxy.messages.in:
2385         * UIProcess/WebUIClient.cpp:
2386         * UIProcess/WebUIClient.h:
2387         * WebKit2.pro:
2388         * WebKit2.xcodeproj/project.pbxproj:
2389         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: Removed.
2390         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h: Removed.
2391         * WebProcess/Geolocation/WebGeolocationManager.cpp:
2392         * WebProcess/Geolocation/WebGeolocationManager.h:
2393         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
2394         (WebKit::WebGeolocationClient::requestPermission):
2395         (WebKit::WebGeolocationClient::cancelPermissionRequest):
2396         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
2397         * WebProcess/WebPage/WebPage.cpp:
2398         (WebKit::WebPage::WebPage):
2399         * WebProcess/WebPage/WebPage.h:
2400         * WebProcess/WebPage/WebPage.messages.in:
2401         * win/WebKit2.vcproj:
2402         * win/WebKit2Generated.make:
2403
2404 2011-01-10  Csaba Osztrogonác  <ossy@webkit.org>
2405
2406         Unreviewed, rolling out r75459
2407         http://trac.webkit.org/changeset/75459
2408
2409         Work towards having the WebPageProxy decide when to create the DrawingAreaProxy
2410         https://bugs.webkit.org/show_bug.cgi?id=52184
2411
2412         * UIProcess/API/mac/PageClientImpl.h:
2413         * UIProcess/API/mac/PageClientImpl.mm:
2414         * UIProcess/API/mac/WKView.mm:
2415         * UIProcess/API/mac/WKViewInternal.h:
2416         * UIProcess/API/qt/qwkpage.cpp:
2417         * UIProcess/API/qt/qwkpage_p.h:
2418         * UIProcess/PageClient.h:
2419         * UIProcess/WebPageProxy.cpp:
2420         (WebKit::WebPageProxy::initializeWebPage):
2421         (WebKit::WebPageProxy::reinitializeWebPage):
2422         * UIProcess/win/WebView.cpp:
2423         (WebKit::WebView::WebView):
2424         * UIProcess/win/WebView.h:
2425
2426 2011-01-10  Anders Carlsson  <andersca@apple.com>
2427
2428         Reviewed by Sam Weinig.
2429
2430         Remove size parameter to WebPageProxy::initializeWebPage
2431         https://bugs.webkit.org/show_bug.cgi?id=52188
2432
2433         * UIProcess/API/mac/WKView.mm:
2434         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
2435         * UIProcess/API/qt/qwkpage.cpp:
2436         (QWKPagePrivate::init):
2437         * UIProcess/WebPageProxy.cpp:
2438         (WebKit::WebPageProxy::initializeWebPage):
2439         * UIProcess/WebPageProxy.h:
2440         * UIProcess/win/WebView.cpp:
2441         (WebKit::WebView::WebView):
2442
2443 2011-01-10  Anders Carlsson  <andersca@apple.com>
2444
2445         Didn't mean to land this.
2446
2447         * UIProcess/WebPageProxy.cpp:
2448         (WebKit::WebPageProxy::initializeWebPage):
2449         * UIProcess/WebPageProxy.h:
2450
2451 2011-01-10  Anders Carlsson  <andersca@apple.com>
2452
2453         Reviewed by Sam Weinig.
2454
2455         WebPageProxy::creationParameters no longer needs to take a size
2456         https://bugs.webkit.org/show_bug.cgi?id=52187
2457
2458         WebPageProxy::creationParameters can just ask the page client for the view size now.
2459
2460         * UIProcess/WebInspectorProxy.cpp:
2461         (WebKit::WebInspectorProxy::createInspectorPage):
2462         * UIProcess/WebPageProxy.cpp:
2463         (WebKit::WebPageProxy::initializeWebPage):
2464         (WebKit::WebPageProxy::reinitializeWebPage):
2465         (WebKit::WebPageProxy::createNewPage):
2466         (WebKit::WebPageProxy::creationParameters):
2467         * UIProcess/WebPageProxy.h:
2468
2469 2011-01-10  Anders Carlsson  <andersca@apple.com>
2470
2471         Reviewed by Sam Weinig.
2472
2473         Pass information about the view in the WebPageCreationParameters
2474         https://bugs.webkit.org/show_bug.cgi?id=52186
2475
2476         * Shared/WebPageCreationParameters.cpp:
2477         (WebKit::WebPageCreationParameters::encode):
2478         (WebKit::WebPageCreationParameters::decode):
2479         Encode and decode the state flags.
2480
2481         * Shared/WebPageCreationParameters.h:
2482         Add new state flags.
2483
2484         * UIProcess/WebPageProxy.cpp:
2485         (WebKit::WebPageProxy::creationParameters):
2486         Initialize the state flags.
2487
2488         * WebProcess/WebPage/WebPage.cpp:
2489         (WebKit::WebPage::WebPage):
2490         Update the page state from the state flags.
2491
2492 2011-01-10  Sam Weinig  <sam@webkit.org>
2493
2494         Reviewed by Anders Carlsson.
2495
2496         Make Geolocation features work in WebKit2
2497         https://bugs.webkit.org/show_bug.cgi?id=52078
2498
2499         Step 2 - Add support for requesting and granting permission for geolocation.
2500
2501         * Shared/API/c/WKBase.h:
2502         * Shared/APIObject.h:
2503         * UIProcess/API/C/WebKit2.h:
2504         * UIProcess/API/C/WKAPICast.h:
2505         * UIProcess/API/C/WKGeolocationPermissionRequest.cpp: Added.
2506         * UIProcess/API/C/WKGeolocationPermissionRequest.h: Added.
2507         Add new API type, WKGeolocationPermissionRequestRef.
2508
2509         * UIProcess/API/C/WKPage.h:
2510         Add new UIClient function for requesting permission.
2511
2512         * UIProcess/API/qt/qwkpage.cpp:
2513         (QWKPage::QWKPage): 
2514         Stub out the UIClient.
2515
2516         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: Added.
2517         * UIProcess/GeolocationPermissionRequestManagerProxy.h: Added.
2518         * UIProcess/GeolocationPermissionRequestProxy.cpp: Added.
2519         * UIProcess/WebPageProxy.cpp:
2520         * UIProcess/WebPageProxy.h:
2521         * UIProcess/WebPageProxy.messages.in:
2522         * UIProcess/WebUIClient.cpp:
2523         * UIProcess/WebUIClient.h:
2524         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: Added.
2525         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h: Added.
2526         * WebProcess/Geolocation/WebGeolocationManager.cpp:
2527         * WebProcess/Geolocation/WebGeolocationManager.h:
2528         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
2529         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
2530         * WebProcess/WebPage/WebPage.cpp:
2531         (WebKit::WebPage::WebPage):
2532         (WebKit::WebPage::didReceiveGeolocationPermissionDecision):
2533         * WebProcess/WebPage/WebPage.h:
2534         (WebKit::WebPage::geolocationPermissionRequestManager):
2535         * WebProcess/WebPage/WebPage.messages.in:
2536         Track the permission request through both sides of the process divide.
2537
2538         * WebKit2.pro:
2539         * WebKit2.xcodeproj/project.pbxproj:
2540         * win/WebKit2.vcproj:
2541         * win/WebKit2Generated.make:
2542         Add new files.
2543
2544 2011-01-10  Anders Carlsson  <andersca@apple.com>
2545
2546         Reviewed by Sam Weinig.
2547
2548         Work towards having the WebPageProxy decide when to create the DrawingAreaProxy
2549         https://bugs.webkit.org/show_bug.cgi?id=52184
2550
2551         * UIProcess/API/mac/PageClientImpl.h:
2552         * UIProcess/API/mac/PageClientImpl.mm:
2553         (WebKit::PageClientImpl::createDrawingAreaProxy):
2554         Call -[WKView _createDrawingAreaProxy].
2555
2556         (WebKit::PageClientImpl::setViewNeedsDisplay):
2557         Call setNeedsDisplayInRect on the WKView.
2558
2559         * UIProcess/API/mac/WKView.mm:
2560         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
2561         No need to set the drawing area proxy anymore.
2562
2563         (-[WKView _createDrawingAreaProxy]):
2564         Create a chunked update drawing area proxy for now.
2565
2566         * UIProcess/API/qt/qwkpage.cpp:
2567         (QWKPagePrivate::createDrawingAreaProxy):
2568         (QWKPagePrivate::setViewNeedsDisplay):
2569         Add stubs.
2570     
2571         * UIProcess/PageClient.h:
2572         Add new pure virtual member functions.
2573
2574         * UIProcess/WebPageProxy.cpp:
2575         (WebKit::WebPageProxy::initializeWebPage):
2576         (WebKit::WebPageProxy::reinitializeWebPage):
2577         Set the new drawing area proxy.
2578
2579         * UIProcess/win/WebView.cpp:
2580         (WebKit::WebView::WebView):
2581         No need to set the drawing area proxy anymore.
2582
2583         (WebKit::WebView::createDrawingAreaProxy):
2584         Create a chunked update drawing area proxy for now.
2585
2586         (WebKit::WebView::setViewNeedsDisplay):
2587         Invalidate the window.
2588
2589 2011-01-10  Anders Carlsson  <andersca@apple.com>
2590
2591         Fix Windows build again.
2592
2593         * UIProcess/win/WebView.cpp:
2594         (WebKit::WebView::isViewWindowActive):
2595
2596 2011-01-10  Anders Carlsson  <andersca@apple.com>
2597
2598         Fix Windows build.
2599
2600         * UIProcess/win/WebView.cpp:
2601         (WebKit::WebView::onShowWindowEvent):
2602
2603 2011-01-10  Anders Carlsson  <andersca@apple.com>
2604
2605         Reviewed by Sam Weinig.
2606
2607         Use a pull model for view state changes
2608         https://bugs.webkit.org/show_bug.cgi?id=52175
2609
2610         Instead of having the WKView call setFocused, setActive etc on the WebPageProxy, the
2611         WKView now simply informs the WebPageProxy what has changed, using the WebPageProxy::viewStateDidChange
2612         function. The WebPageProxy can then fetch the relevant information using newly added PageClient functions.
2613
2614         * UIProcess/API/mac/PageClientImpl.h:
2615         * UIProcess/API/mac/PageClientImpl.mm:
2616         (WebKit::PageClientImpl::viewSize):
2617         (WebKit::PageClientImpl::isViewWindowActive):
2618         (WebKit::PageClientImpl::isViewFocused):
2619         (WebKit::PageClientImpl::isViewVisible):
2620         (WebKit::PageClientImpl::isViewInWindow):
2621         * UIProcess/API/mac/WKView.mm:
2622         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
2623         (-[WKView becomeFirstResponder]):
2624         (-[WKView resignFirstResponder]):
2625         (-[WKView viewDidMoveToWindow]):
2626         (-[WKView _windowDidBecomeKey:]):
2627         (-[WKView _windowDidResignKey:]):
2628         (-[WKView viewDidHide]):
2629         (-[WKView viewDidUnhide]):
2630         (-[WKView _isFocused]):
2631         (-[WKView _didRelaunchProcess]):
2632         * UIProcess/API/mac/WKViewInternal.h:
2633         * UIProcess/API/qt/qgraphicswkview.cpp:
2634         (QGraphicsWKView::focusInEvent):
2635         (QGraphicsWKView::focusOutEvent):
2636         * UIProcess/API/qt/qwkpage.cpp:
2637         (QWKPagePrivate::QWKPagePrivate):
2638         (QWKPagePrivate::viewSize):
2639         (QWKPagePrivate::isViewWindowActive):
2640         (QWKPagePrivate::isViewFocused):
2641         (QWKPagePrivate::isViewVisible):
2642         (QWKPagePrivate::isViewInWindow):
2643         * UIProcess/API/qt/qwkpage_p.h:
2644         * UIProcess/PageClient.h:
2645         * UIProcess/WebContext.cpp:
2646         (WebKit::WebContext::createWebPage):
2647         * UIProcess/WebContext.h:
2648         * UIProcess/WebPageProxy.cpp:
2649         (WebKit::WebPageProxy::create):
2650         (WebKit::WebPageProxy::WebPageProxy):
2651         (WebKit::WebPageProxy::viewStateDidChange):
2652         * UIProcess/WebPageProxy.h:
2653         * UIProcess/WebProcessProxy.cpp:
2654         (WebKit::WebProcessProxy::createWebPage):
2655         * UIProcess/WebProcessProxy.h:
2656         * UIProcess/win/WebView.cpp:
2657         (WebKit::WebView::WebView):
2658         (WebKit::WebView::onSetFocusEvent):
2659         (WebKit::WebView::onKillFocusEvent):
2660         (WebKit::WebView::onShowWindowEvent):
2661         (WebKit::WebView::updateActiveState):
2662         (WebKit::WebView::viewSize):
2663         (WebKit::WebView::isViewWindowActive):
2664         (WebKit::WebView::isViewFocused):
2665         (WebKit::WebView::isViewVisible):
2666         (WebKit::WebView::isViewInWindow):
2667         (WebKit::WebView::didRelaunchProcess):
2668         (WebKit::WebView::setIsInWindow):
2669         * UIProcess/win/WebView.h:
2670
2671 2011-01-10  Adam Roben  <aroben@apple.com>
2672
2673         Don't pass a reference type to va_start
2674
2675         C++ says this results in undefined behavior:
2676
2677             The restrictions that ISO C places on the second parameter to the
2678             va_start() macro in header <stdarg.h> are different in this
2679             International Standard. The parameter parmN is the identifier of
2680             the rightmost parameter in the variable parameter list of the
2681             function definition (the one just before the ...).221) If the
2682             parameter parmN is declared with a function, array, or reference
2683             type, or with a type that is not compatible with the type that
2684             results when passing an argument for which there is no parameter,
2685             the behavior is undefined.
2686
2687         Fixes <http://webkit.org/b/52168> Title of standalone image document
2688         includes bogus image dimensions
2689
2690         Rubber-stamped by Eric Seidel.
2691
2692         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2693         (WebKit::formatLocalizedString): Don't use a reference type for
2694         |format|.
2695
2696 2011-01-10  Siddharth Mathur  <siddharth.mathur@nokia.com>
2697
2698         Reviewed by Eric Seidel.
2699
2700         Support for ARM's RVCT(ARMCC) compiler in import/export directives
2701         https://bugs.webkit.org/show_bug.cgi?id=52146 
2702
2703         * Shared/API/c/WKBase.h:
2704
2705 2011-01-10  Sam Weinig  <sam@webkit.org>
2706
2707         Fix the build.
2708
2709         * WebProcess/WebPage/WebPage.cpp:
2710         (WebKit::WebPage::WebPage):
2711
2712 2011-01-10  Sam Weinig  <sam@webkit.org>
2713
2714         Reviewed by Anders Carlsson.
2715
2716         Make Geolocation features work in WebKit2
2717         https://bugs.webkit.org/show_bug.cgi?id=52078
2718
2719         Step 1 - Add enough support to get position data from a provider.
2720         This does not include permission support.
2721
2722         * Platform/CoreIPC/HandleMessage.h:
2723         Add #include of Arguments.h for CoreIPC::In and Out definitions.
2724
2725         * Platform/CoreIPC/MessageID.h:
2726         Add new message types.
2727
2728         * Shared/API/c/WKBase.h:
2729         * Shared/APIObject.h:
2730         Add new API types.
2731
2732         * Shared/WebGeolocationPosition.cpp: Added.
2733         * Shared/WebGeolocationPosition.h: Added.
2734         Internal position representation.
2735
2736         * UIProcess/API/C/WKAPICast.h:
2737         Add casts for new API types.
2738
2739         * UIProcess/API/C/WKContext.cpp:
2740         * UIProcess/API/C/WKContext.h:
2741         * UIProcess/API/C/WKGeolocationManager.cpp: Added.
2742         * UIProcess/API/C/WKGeolocationManager.h: Added.
2743         * UIProcess/API/C/WKGeolocationPosition.cpp: Added.
2744         * UIProcess/API/C/WKGeolocationPosition.h: Added.
2745         * UIProcess/API/C/WebKit2.h:
2746         Add API to provide and control geolocation data.
2747
2748         * UIProcess/WebContext.cpp:
2749         (WebKit::WebContext::WebContext):
2750         (WebKit::WebContext::~WebContext):
2751         (WebKit::WebContext::processDidClose):
2752         (WebKit::WebContext::didReceiveMessage):
2753         * UIProcess/WebContext.h:
2754         (WebKit::WebContext::geolocationManagerProxy):
2755         * UIProcess/WebGeolocationManagerProxy.cpp: Added.
2756         (WebKit::WebGeolocationManagerProxy::create):
2757         (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy):
2758         (WebKit::WebGeolocationManagerProxy::~WebGeolocationManagerProxy):
2759         (WebKit::WebGeolocationManagerProxy::invalidate):
2760         (WebKit::WebGeolocationManagerProxy::initializeProvider):
2761         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition):
2762         (WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition):
2763         (WebKit::WebGeolocationManagerProxy::didReceiveMessage):
2764         (WebKit::WebGeolocationManagerProxy::startUpdating):
2765         (WebKit::WebGeolocationManagerProxy::stopUpdating):
2766         * UIProcess/WebGeolocationManagerProxy.h: Added.
2767         (WebKit::WebGeolocationManagerProxy::clearContext):
2768         (WebKit::WebGeolocationManagerProxy::type):
2769         * UIProcess/WebGeolocationManagerProxy.messages.in: Added.
2770         * UIProcess/WebGeolocationProvider.cpp: Added.
2771         (WebKit::WebGeolocationProvider::startUpdating):
2772         (WebKit::WebGeolocationProvider::stopUpdating):
2773         * UIProcess/WebGeolocationProvider.h: Added.
2774         * UIProcess/WebProcessProxy.cpp:
2775         (WebKit::WebProcessProxy::didReceiveMessage):
2776         * WebProcess/Geolocation: Added.
2777         * WebProcess/Geolocation/WebGeolocationManager.cpp: Added.
2778         (WebKit::WebGeolocationManager::WebGeolocationManager):
2779         (WebKit::WebGeolocationManager::~WebGeolocationManager):
2780         (WebKit::WebGeolocationManager::didReceiveMessage):
2781         (WebKit::WebGeolocationManager::registerWebPage):
2782         (WebKit::WebGeolocationManager::unregisterWebPage):
2783         (WebKit::WebGeolocationManager::didChangePosition):
2784         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
2785         * WebProcess/Geolocation/WebGeolocationManager.h: Added.
2786         * WebProcess/Geolocation/WebGeolocationManager.messages.in: Added.
2787         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: Added.
2788         (WebKit::WebGeolocationClient::geolocationDestroyed):
2789         (WebKit::WebGeolocationClient::startUpdating):
2790         (WebKit::WebGeolocationClient::stopUpdating):
2791         (WebKit::WebGeolocationClient::setEnableHighAccuracy):
2792         (WebKit::WebGeolocationClient::lastPosition):
2793         (WebKit::WebGeolocationClient::requestPermission):
2794         (WebKit::WebGeolocationClient::cancelPermissionRequest):
2795         * WebProcess/WebCoreSupport/WebGeolocationClient.h: Added.
2796         (WebKit::WebGeolocationClient::WebGeolocationClient):
2797         * WebProcess/WebPage/WebPage.cpp:
2798         (WebKit::WebPage::WebPage):
2799         * WebProcess/WebProcess.cpp:
2800         (WebKit::WebProcess::WebProcess):
2801         (WebKit::WebProcess::didReceiveMessage):
2802         * WebProcess/WebProcess.h:
2803         (WebKit::WebProcess::geolocationManager):
2804         Pipe geolocation positions/errors from the UIProcess to the WebProcess.
2805
2806         * DerivedSources.make:
2807         * DerivedSources.pro:
2808         * WebKit2.pro:
2809         * WebKit2.xcodeproj/project.pbxproj:
2810         * win/WebKit2.vcproj:
2811         * win/WebKit2Common.vsprops:
2812          * win/WebKit2Generated.make:
2813         Add new files.
2814
2815 2011-01-10  Martin Robinson  <mrobinson@igalia.com>
2816
2817         GTK+ build fix. Continue to fix 'make dist.'
2818
2819         * GNUmakefile.am: Remove more non-existent files from the WebKit2 build.
2820
2821 2011-01-10  Alejandro G. Castro  <alex@igalia.com>
2822
2823         Reviewed by Martin Robinson.
2824
2825         [GTK] Remove webkit2 files that are still not added to the
2826         repository from the makefile
2827         https://bugs.webkit.org/show_bug.cgi?id=52145
2828
2829         This change is required for the release, we can add the lines
2830         again to the makefiles with the patches adding the files.
2831
2832         * GNUmakefile.am:
2833
2834 2011-01-10  Andreas Kling  <kling@webkit.org>
2835
2836         Reviewed by Simon Hausmann.
2837
2838         [Qt] [WK2] MiniBrowser does not load pages opened in new windows
2839         https://bugs.webkit.org/show_bug.cgi?id=52111
2840
2841         * UIProcess/API/qt/qwkpage.cpp:
2842         (QWKPage::context): Implement this method.
2843
2844 2011-01-09  Dan Bernstein  <mitz@apple.com>
2845
2846         Reviewed by Simon Fraser.
2847
2848         <rdar://problem/8839498> Assertion failure in KURL::KURL when calling WKURLRequestCreateWithWKURL with a non-parsed URL
2849         https://bugs.webkit.org/show_bug.cgi?id=52132
2850
2851         * Shared/API/c/WKURLRequest.cpp:
2852         (WKURLRequestCreateWithWKURL): Parse the URL.
2853         * Shared/WebString.h: Fixed a comment.
2854         * Shared/WebURL.h: Ditto.
2855
2856 2011-01-09  Amruth Raj  <amruthraj@motorola.com> and Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com>
2857
2858         Reviewed by Martin Robinson.
2859
2860         Changes to add Process Launcher and Thread Launcher implementation to the WebKit2 GTK port.
2861         The main() implementation for WebKitWebProcess binary to launch Web process from UI process.
2862         https://bugs.webkit.org/show_bug.cgi?id=48511
2863
2864         * UIProcess/Launcher/gtk: Added.
2865         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: Added. GTK (UNIX_X11 specific) implementation
2866         (WebKit::ProcessLauncher::launchProcess):
2867         (WebKit::ProcessLauncher::terminateProcess):
2868         (WebKit::ProcessLauncher::platformInvalidate):
2869         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp: Added. Stubbed implementation for GTK port. Yet to implement.
2870         (WebKit::ThreadLauncher::createWebThread):
2871         * WebProcess/gtk: Added.
2872         * WebProcess/gtk/WebProcessGtk.cpp: Added. The stubbed implementations of virtual functions of WebProcess.h for GTK port.
2873         (WebKit::WebProcess::platformSetCacheModel):
2874         (WebKit::WebProcess::platformClearResourceCaches):
2875         (WebKit::WebProcess::platformInitializeWebProcess):
2876         (WebKit::WebProcess::platformShutdown):
2877         * WebProcess/gtk/WebProcessMainGtk.cpp: Added. The WebProcessMain call which initiates the Web Process for GTK port.
2878         (WebKit::WebProcessMainGtk):
2879         * WebProcess/gtk/WebProcessMainGtk.h: Added. The WebProcessMain declaration for Web Process for GTK port.
2880         * gtk/MainGtk.cpp: Added. The main function implementation for binary WebKitWebProcess.
2881         (main):
2882
2883 2011-01-07 Amruth Raj  <amruthraj@motorola.com> and Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com>
2884
2885         Reviewed by Martin Robinson.
2886
2887         [GTK] WebKit2 GNUmakefile is out of date from trunk
2888         https://bugs.webkit.org/show_bug.cgi?id=51883
2889
2890         * GNUmakefile.am: Updated sources list as per latest revision
2891         * Platform/gtk/RunLoopGtk.cpp:
2892         (RunLoop::TimerBase::start):
2893         * Platform/gtk/WorkQueueGtk.cpp:
2894         (WorkQueue::scheduleWorkAfterDelay):
2895         * Shared/gtk/BackingStoreGtk.cpp:
2896         (WebKit::BackingStore::paint):
2897         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
2898         (WebKit::InjectedBundle::load):
2899         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
2900         (WebKit::NetscapePlugin::platformInvalidate):
2901
2902 2011-01-08  Dan Bernstein  <mitz@apple.com>
2903
2904         Reviewed by Sam Weinig.
2905
2906         <rdar://problem/8812759> In WebKit2, PDF view settings (mode and scale) do not stick
2907         https://bugs.webkit.org/show_bug.cgi?id=52118
2908
2909         * Shared/WebPreferencesStore.cpp:
2910         (WebKit::WebPreferencesStore::encode): Encode the double values map.
2911         (WebKit::WebPreferencesStore::decode): Decode the double values map.
2912         (WebKit::defaultValueForKey): Added double instance.
2913         (WebKit::WebPreferencesStore::setDoubleValueForKey): Added.
2914         (WebKit::WebPreferencesStore::getDoubleValueForKey): Added.
2915         * Shared/WebPreferencesStore.h: Added PDFScaleFactor and PDFDisplayMode preferences.
2916         * UIProcess/API/mac/PDFViewController.mm:
2917         (-[WKPDFView initWithFrame:PDFViewController:WebKit::]): Initialize the _pdfViewController ivar.
2918         (-[WKPDFView invalidate]): Changed 'nil' to '0' in assignment to a non-Objective-C pointer.
2919         (-[WKPDFView setDocument:]): Added.
2920         (-[WKPDFView _applyPDFPreferences]): Added.
2921         (-[WKPDFView _updatePreferences:]): Added.
2922         (-[WKPDFView _updatePreferencesSoon]): Added.
2923         (-[WKPDFView _scaleOrDisplayModeOrPageChanged:]): Added.
2924         (-[WKPDFView viewDidMoveToWindow]): Added. Starts observing the PDF view for changes to scale
2925         and display mode.
2926         (-[WKPDFView viewWillMoveToWindow:]): Added. Stops observing for changes.
2927         (WebKit::PDFViewController::setPDFDocumentData): Changed to call throguh -[WKPDFView setDocument:].
2928         * UIProcess/WebPreferences.cpp:
2929         (WebKit::WebPreferences::updateDoubleValueForKey): Added.
2930         * UIProcess/WebPreferences.h:
2931         * UIProcess/cf/WebPreferencesCF.cpp:
2932         (WebKit::WebPreferences::platformUpdateDoubleValueForKey): Added empty implementation.
2933         * UIProcess/gtk/WebPreferencesGtk.cpp:
2934         (WebKit::WebPreferences::platformUpdateDoubleValueForKey): Added stub.
2935         * UIProcess/mac/WebPreferencesMac.mm:
2936         (WebKit::setDoubleValueIfInUserDefaults): Added.
2937         (WebKit::WebPreferences::platformUpdateDoubleValueForKey): Added.
2938         * UIProcess/qt/WebPreferencesQt.cpp:
2939         (WebKit::WebPreferences::platformUpdateDoubleValueForKey): Added.
2940
2941 2011-01-08  Dan Bernstein  <mitz@apple.com>
2942
2943         Reviewed by Maciej Stachowiak.
2944
2945         In WebKit2, page zooming does not work with PDF
2946         https://bugs.webkit.org/show_bug.cgi?id=52113
2947
2948         * UIProcess/API/C/WKPage.cpp:
2949         (WKPageSupportsTextZoom): Added. Returns whether the page currently supports text-only zoom.
2950         * UIProcess/API/C/WKPage.h:
2951         * UIProcess/API/mac/PDFViewController.h: Made pdfDocumentClass() private and declared new
2952         member functions.
2953         * UIProcess/API/mac/PDFViewController.mm:
2954         (WebKit::PDFViewController::zoomFactor): Added.
2955         (WebKit::PDFViewController::setZoomFactor): Added.
2956         * UIProcess/API/mac/PageClientImpl.h:
2957         * UIProcess/API/mac/PageClientImpl.mm:
2958         (WebKit::PageClientImpl::customRepresentationZoomFactor): Added. Calls through to the WKView.
2959         (WebKit::PageClientImpl::setCustomRepresentationZoomFactor): Ditto.
2960         * UIProcess/API/mac/WKView.mm:
2961         (-[WKView _customRepresentationZoomFactor]): Added. Calls through to the PDFViewController.
2962         (-[WKView _setCustomRepresentationZoomFactor:]): Ditto.
2963         * UIProcess/API/mac/WKViewInternal.h:
2964         * UIProcess/API/qt/qwkpage_p.h:
2965         (QWKPagePrivate::customRepresentationZoomFactor): Added.
2966         (QWKPagePrivate::setCustomRepresentationZoomFactor): Added.
2967         * UIProcess/PageClient.h:
2968         * UIProcess/WebPageProxy.cpp:
2969         (WebKit::WebPageProxy::WebPageProxy): Coding style fix.
2970         (WebKit::WebPageProxy::supportsTextZoom): Added. Returns false if the main frame has a custom
2971         representation or is a standalone image, true otherwise.
2972         (WebKit::WebPageProxy::setTextZoomFactor): Bail out if the main frame has a custom representation.
2973         (WebKit::WebPageProxy::pageZoomFactor): If the main frame has a custom representation, get the
2974         zoom factor from the page client.
2975         (WebKit::WebPageProxy::setPageZoomFactor): If the main frame has a custom representation, have
2976         the client set the zoom factor.
2977         (WebKit::WebPageProxy::setPageAndTextZoomFactors): Ditto.
2978         * UIProcess/WebPageProxy.h:
2979         (WebKit::WebPageProxy::textZoomFactor): Changed to return 1 if the main frame has a custom
2980         representation.
2981         * UIProcess/win/WebView.cpp:
2982         (WebKit::WebView::customRepresentationZoomFactor): Added.
2983         (WebKit::WebView::setCustomRepresentationZoomFactor): Added.
2984         * UIProcess/win/WebView.h:
2985
2986 2011-01-08  Jeff Miller  <jeffm@apple.com>
2987
2988         Reviewed by Jon Honeycutt.
2989
2990         Add WKBundleFrameGetVisibleContentBounds().
2991         https://bugs.webkit.org/show_bug.cgi?id=52089
2992
2993         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2994         (WKBundleFrameGetVisibleContentBounds):
2995         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
2996         Added WKBundleFrameGetVisibleContentBounds().
2997
2998 2011-01-08  Balazs Kelemen  <kbalazs@webkit.org>
2999
3000         Reviewed by Kenneth Rohde Christiansen.
3001
3002         [Qt][WK2] QWKView does not propagate show and hide events to the drawing area
3003         https://bugs.webkit.org/show_bug.cgi?id=52108
3004
3005         * UIProcess/API/qt/qgraphicswkview.cpp:
3006         (QGraphicsWKView::event): Call setPageIsVisible on the drawing area
3007         if the event is Show or Hide.
3008
3009 2011-01-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3010
3011         Reviewed by Kenneth Rohde Christiansen.
3012
3013         [Qt][Symbian] Make sure WebKit headers are included before platform headers on Symbian
3014         https://bugs.webkit.org/show_bug.cgi?id=31273
3015
3016         On Symbian PREPEND_INCLUDEPATH is the best way to make sure that WebKit headers
3017         are included before platform headers. On all other platforms continue to use
3018         INCLUDEPATH (as before).
3019
3020         * WebKit2.pro:
3021
3022 2011-01-08  Csaba Osztrogonác  <ossy@webkit.org>
3023
3024         [Qt][WK2] Unreviewed buildfix after r75313.
3025
3026         * Scripts/generate-forwarding-headers.pl:
3027
3028 2011-01-08  Adam Barth  <abarth@webkit.org>
3029
3030         Moving WebCore changes the layout of the Qt build directory as well,
3031         which means we need to change where we look for these generated files.
3032
3033         * DerivedSources.pro:
3034
3035 2011-01-07  Adam Barth  <abarth@webkit.org>
3036
3037         Rubber-stamped by Eric Seidel.
3038
3039         Move WebCore to Source
3040         https://bugs.webkit.org/show_bug.cgi?id=52050
3041
3042         * WebKit2.pro:
3043
3044 2011-01-07  Stephanie Lewis  <slewis@apple.com>
3045
3046         Reviewed by Geoff Garen.
3047
3048         <rdar://problem/8649617> Migrate memory tracking from Safari to WebKit
3049         https://bugs.webkit.org/show_bug.cgi?id=50799 Add Memory Sampler to WebKit
3050         
3051         Add a sampler for printing off process memory statistics.
3052         This tool can track:
3053                 
3054                 WebCore
3055                    - FastMalloc allocations bytes              (in use or committed)
3056                 JavaScriptCore
3057                    - Garbage collector heap bytes              (in use or committed)
3058                    - Stack bytes                               (committed only!)
3059                    - JIT Code bytes                            (committed only!)
3060                 Malloc zones
3061                    - In use bytes for the following zones:
3062                        * Default zone                          (in use or committed)
3063                        * DispCon zone                          (in use or committed)
3064                        * Purgable zone                         (in use or committed)
3065                 Task Info
3066                    - Resident size memory (RSIZE)
3067         
3068                 Data collected is dumped to a temporary file.
3069         
3070         Create a sandbox for a temporary file.
3071         * Shared/SandboxExtension.h:
3072         (WebKit::SandboxExtension::createHandleForTemporaryFile):
3073         * Shared/mac/SandboxExtensionMac.mm:
3074         (WebKit::SandboxExtension::createHandleForTemporaryFile):
3075         
3076         Memory Sampler files
3077         
3078         * Shared/WebMemorySampler.cpp: Added.
3079         (WebKit::WebMemorySampler::shared):
3080         (WebKit::WebMemorySampler::WebMemorySampler):
3081         (WebKit::WebMemorySampler::start):
3082         (WebKit::WebMemorySampler::initializeTimers):
3083         (WebKit::WebMemorySampler::stop):
3084         (WebKit::WebMemorySampler::isRunning):
3085         (WebKit::WebMemorySampler::initializeTempLogFile):
3086         (WebKit::WebMemorySampler::initializeSandboxedLogFile):
3087         (WebKit::WebMemorySampler::writeHeaders):
3088         (WebKit::WebMemorySampler::sampleTimerFired):
3089         (WebKit::WebMemorySampler::stopTimerFired):
3090         (WebKit::WebMemorySampler::appendCurrentMemoryUsageToFile):
3091         * Shared/WebMemorySampler.h: Added.
3092         * Shared/mac/WebMemorySampler.mac.mm: Added.
3093         (WebKit::WebMemorySampler::sampleSystemMalloc):
3094         (WebKit::WebMemorySampler::sampleProcessCommittedBytes):
3095         (WebKit::WebMemorySampler::processName):
3096         (WebKit::WebMemorySampler::sampleWebKit):
3097         
3098         API to start and stop UIProcess and WebProcess sampling.
3099         
3100         * UIProcess/API/C/WKContext.cpp:
3101         (WKContextStartMemorySampler):
3102         (WKContextStopMemorySampler):
3103         * UIProcess/API/C/WKContext.h:
3104         
3105         Send messages to WebProcess to start and stop memory sampling.
3106         
3107         * UIProcess/WebContext.cpp:
3108         (WebKit::WebContext::WebContext):
3109         (WebKit::WebContext::processDidFinishLaunching):
3110         (WebKit::WebContext::startMemorySampler):
3111         (WebKit::WebContext::stopMemorySampler):
3112         * UIProcess/WebContext.h:
3113         * WebKit2.xcodeproj/project.pbxproj:
3114         * WebProcess/WebProcess.cpp:
3115         (WebKit::WebProcess::startMemorySampler):
3116         (WebKit::WebProcess::stopMemorySampler):
3117         * WebProcess/WebProcess.h:
3118         * WebProcess/WebProcess.messages.in:
3119
3120 2011-01-07  Jessie Berlin  <jberlin@apple.com>
3121
3122         Reviewed by Dan Bernstein.
3123
3124         WebKit2: Need WKBundleFrameCopyProvisionalURL
3125         https://bugs.webkit.org/show_bug.cgi?id=52083
3126
3127         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3128         (WKBundleFrameCopyProvisionalURL):
3129         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
3130         * WebProcess/WebPage/WebFrame.cpp:
3131         (WebKit::WebFrame::provisionalURL):
3132         Grab the URL from the provisional document loader.
3133         * WebProcess/WebPage/WebFrame.h:
3134
3135 2011-01-07  James Robinson  <jamesr@chromium.org>
3136
3137         Revert "Implement mozilla's animationTime property"
3138         https://bugs.webkit.org/show_bug.cgi?id=51952
3139
3140         This approach isn't quite right.
3141
3142         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
3143         (WebKit::ChunkedUpdateDrawingArea::display):
3144         (WebKit::ChunkedUpdateDrawingArea::setSize):
3145         * WebProcess/WebPage/WebPage.cpp:
3146         (WebKit::WebPage::drawRect):
3147         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
3148         (WebKit::LayerBackedDrawingArea::syncCompositingLayers):
3149
3150 2011-01-07 Amruth Raj  <amruthraj@motorola.com> and Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com>
3151
3152         Reviewed by Martin Robinson.
3153
3154         [GTK] WebKit2 GNUmakefile is out of date from trunk
3155         Adding new stub files for compiling on latest revision
3156         https://bugs.webkit.org/show_bug.cgi?id=51883
3157
3158         * UIProcess/gtk: Added.
3159         * UIProcess/gtk/TextCheckerGtk.cpp: Added.
3160         (WebKit::TextChecker::state):
3161         (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
3162         (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
3163         (WebKit::TextChecker::setGrammarCheckingEnabled):
3164         (WebKit::TextChecker::uniqueSpellDocumentTag):
3165         (WebKit::TextChecker::closeSpellDocumentWithTag):
3166         (WebKit::TextChecker::checkTextOfParagraph):
3167         (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
3168         (WebKit::TextChecker::getGuessesForWord):
3169         (WebKit::TextChecker::learnWord):
3170         (WebKit::TextChecker::ignoreWord):
3171         * UIProcess/gtk/WebInspectorGtk.cpp: Added.
3172         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3173         (WebKit::WebInspectorProxy::platformOpen):
3174         (WebKit::WebInspectorProxy::platformClose):
3175         (WebKit::WebInspectorProxy::inspectorPageURL):
3176         * UIProcess/gtk/WebPageProxyGtk.cpp: Added.
3177         (WebKit::WebPageProxy::standardUserAgent):
3178         * UIProcess/gtk/WebPreferencesGtk.cpp: Added.
3179         (WebKit::WebPreferences::platformInitializeStore):
3180         (WebKit::WebPreferences::platformUpdateStringValueForKey):
3181         (WebKit::WebPreferences::platformUpdateBoolValueForKey):
3182         (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
3183         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp: Added.
3184         (WebKit::WebContextMenuClient::lookUpInDictionary):
3185         (WebKit::WebContextMenuClient::isSpeaking):
3186         (WebKit::WebContextMenuClient::speak):
3187         (WebKit::WebContextMenuClient::stopSpeaking):
3188         * WebProcess/WebCoreSupport/gtk/WebDatabaseManagerGtk.cpp: Added.
3189         (WebKit::WebDatabaseManager::databaseDirectory):
3190         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp: Added.
3191         (WebKit::WebPopupMenu::setUpPlatformData):
3192         * WebProcess/WebPage/gtk: Added.
3193         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp: Added.
3194         (WebKit::WebInspector::localizedStringsURL):
3195
3196 2011-01-06  Adam Roben  <aroben@apple.com>
3197
3198         Don't ever call ::SetCursor(0)
3199
3200         Doing so makes the cursor disappear from the screen.
3201
3202         Fixes <http://webkit.org/b/52024> Mouse cursor flashes when moving it
3203         around a WKView before the web process has finished launching
3204
3205         Reviewed by Jon Honeycutt.
3206
3207         * UIProcess/win/WebView.cpp:
3208         (WebKit::WebView::onSetCursor): If we don't have a cursor to set, just
3209         let Windows do its default thing (which is to set the cursor to the
3210         window class's cursor, which in our case is the arrow cursor).
3211         (WebKit::WebView::cursorToShow): Just return 0 when the page has
3212         crashed so that we'll show the default cursor (which is the arrow
3213         cursor). This change has no visible effect, but seems slightly better
3214         conceptually.
3215         (WebKit::WebView::updateNativeCursor): Don't do anything if we don't
3216         have a cursor to set.
3217
3218 2011-01-06  Adam Roben  <aroben@apple.com>
3219
3220         Fill the WKView with white when the web process hasn't drawn anything
3221         yet
3222
3223         Fixes <http://webkit.org/b/52023> WKView accumulates pixel garbage
3224         before web process has had a chance to draw anything (if Aero is
3225         disabled)
3226
3227         Reviewed by Jon Honeycutt.
3228
3229         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
3230         (WebKit::ChunkedUpdateDrawingAreaProxy::paint):
3231         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
3232         * UIProcess/DrawingAreaProxy.h:
3233         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
3234         (WebKit::LayerBackedDrawingAreaProxy::paint):
3235         * UIProcess/LayerBackedDrawingAreaProxy.h:
3236         * UIProcess/TiledDrawingAreaProxy.cpp:
3237         (WebKit::TiledDrawingAreaProxy::paint):
3238         * UIProcess/TiledDrawingAreaProxy.h:
3239         * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
3240         (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
3241         * UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp:
3242         (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
3243         * UIProcess/win/ChunkedUpdateDrawingAreaProxyWin.cpp:
3244         (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
3245         * UIProcess/win/LayerBackedDrawingAreaProxyWin.cpp:
3246         (WebKit::LayerBackedDrawingAreaProxy::paint):
3247         Changed these functions to return a boolean indicating whether we
3248         actually painted anything.
3249
3250         * UIProcess/win/WebView.cpp:
3251         (WebKit::WebView::onPaintEvent): Fill with white (and don't call
3252         didDraw) when the DrawingAreaProxy isn't able to paint.
3253
3254 2011-01-06  Jessie Berlin  <jberlin@apple.com>
3255
3256         Reviewed by Jon Honeycutt.
3257
3258         WebKit2: Need WKBundlePagePrivate equivalent of WebKit1's WebViewPrivate's setDefersCallbacks
3259         https://bugs.webkit.org/show_bug.cgi?id=52038
3260
3261         The implementation of WebKit1's WebViewPrivate's setDefersCallbacks on both Windows and Mac
3262         calls WebCore::Page::setDefersLoading.
3263
3264         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3265         (WKBundlePageSetDefersLoading):
3266         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
3267         * WebProcess/WebPage/WebPage.cpp:
3268         (WebKit::WebPage::setDefersLoading):
3269         * WebProcess/WebPage/WebPage.h:
3270
3271 2011-01-06  Brady Eidson  <beidson@apple.com>
3272
3273         Reviewed by Darin Adler.
3274
3275         <rdar://problem/8261624> and https://bugs.webkit.org/show_bug.cgi?id=47355
3276         Change WebKit2 session restoring to restore the full back/forward list.
3277
3278         * UIProcess/WebProcessProxy.cpp:
3279         (WebKit::WebProcessProxy::registerNewWebBackForwardListItem): Let the UIProcess register its own
3280           WebBackForwardListItems in its ID map upon creation.
3281         * UIProcess/WebProcessProxy.h:
3282
3283         * UIProcess/cf/WebPageProxyCF.cpp:
3284         (WebKit::WebPageProxy::restoreFromSessionStateData): Register each new list entry in the
3285           UIProcess ID map.
3286
3287         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3288         (WebKit::WebBackForwardListProxy::addItemFromUIProcess): Add this method to register UIProcess
3289           created items without doing any of the other work normally associated with adding a new back/forward item
3290           (such as notifying the UIProcess).
3291         * WebProcess/WebPage/WebBackForwardListProxy.h:
3292
3293         * WebProcess/WebPage/WebPage.cpp:
3294         (WebKit::WebPage::restoreSession): Map all of the back/forward list entries from the UIProcess then
3295           cause a load of the current entry.
3296
3297 2011-01-06  Adam Roben  <aroben@apple.com>
3298
3299         Always show the arrow cursor when the web process has crashed
3300
3301         Fixes <http://webkit.org/b/52006> WKView shows a stale cursor when the
3302         web process crashes
3303
3304         Reviewed by Ada Chan.
3305
3306         * UIProcess/win/WebView.cpp:
3307         (WebKit::WebView::processDidCrash):
3308         (WebKit::WebView::didRelaunchProcess):
3309         Update the cursor to reflect the new state.
3310
3311         (WebKit::WebView::cursorToShow): Always show the arrow cursor when the
3312         web process has crashed.
3313
3314 2011-01-06  Adam Roben  <aroben@apple.com>
3315
3316         Reduce code duplication in WebView::updateNativeCursor
3317
3318         Fixes <http://webkit.org/b/52005> It's not easy to add new behavior to
3319         WebView::updateNativeCursor
3320
3321         Reviewed by Ada Chan.
3322
3323         * UIProcess/win/WebView.cpp:
3324         (WebKit::WebView::cursorToShow): Moved code to choose a cursor here...
3325         (WebKit::WebView::updateNativeCursor): ...from here.
3326
3327         * UIProcess/win/WebView.h: Added cursorToShow.
3328
3329 2011-01-06  Adam Roben  <aroben@apple.com>
3330
3331         Make WKView fill with white when the web process has crashed
3332
3333         Previously we would just draw whatever we had last drawn into the
3334         WKView (i.e., a stale picture of the web page), which was confusing
3335         (because the web page would mysteriously not respond to input) and ugly
3336         (because it wouldn't behave properly if the window was resized).
3337
3338         Fixes <http://webkit.org/b/52004> WKView keeps painting a stale
3339         picture of the web page when the web process crashes
3340
3341         Reviewed by Ada Chan.
3342
3343         * UIProcess/win/WebView.cpp:
3344         (WebKit::WebView::onPaintEvent): Ported code from -[WKView drawRect:]
3345         to fill with white if the page is invalid or has no DrawingArea. As a
3346         bonus, also ported the call to WebPageProxy::didDraw from that method.
3347
3348         (WebKit::WebView::processDidCrash):
3349         (WebKit::WebView::didRelaunchProcess):
3350         Invalidate our window so that we'll redraw with white or the new page.
3351
3352 2011-01-06  Adam Roben  <aroben@apple.com>
3353
3354         Make WKViews work on Windows after a crashed web process gets relaunched
3355
3356         Fixes <http://webkit.org/b/52001> Relaunching the web process fails to
3357         revivify WKViews on Windows
3358
3359         Reviewed by Ada Chan.
3360
3361         * UIProcess/win/WebView.cpp:
3362         (WebKit::WebView::didRelaunchProcess): Implemented by porting code from
3363         -[WKView _didRelaunchProcess].
3364
3365 2011-01-06  Adam Roben  <aroben@apple.com>
3366
3367         Remove WebView::m_rect
3368
3369         It was only used in the constructor, and wasn't even kept up-to-date as
3370         the WebView's size changed.
3371
3372         Fixes <http://webkit.org/b/52000> WebView::m_rect is unnecessary
3373
3374         Reviewed by Ada Chan.
3375
3376         * UIProcess/win/WebView.cpp:
3377         * UIProcess/win/WebView.h:
3378
3379 2011-01-05  Brian Weinstein  <bweinstein@apple.com>
3380
3381         Reviewed by Ada Chan.
3382
3383         WebKit2: Should be able to call into injected bundle to ask if we should allow resource loads
3384         https://bugs.webkit.org/show_bug.cgi?id=51969
3385         
3386         Add the ability to call into the injected bundle to ask if we should allow resource loads.
3387         If the injected bundle says we should cancel, we clear out the ResourceRequest that was
3388         passed into willSendRequest, which cancels the resource load.
3389
3390         * WebProcess/InjectedBundle/API/c/WKBundlePage.h: Add the new callback for allowing/cancelling
3391             resource loads.
3392         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3393         (WebKit::InjectedBundlePageLoaderClient::shouldLoadResourceForFrame): Calls through to the client.
3394         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
3395         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3396         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest): Ask the InjectedBundlePageLoaderClient if we
3397             should load the resource or not.
3398
3399 2011-01-06  Jeff Miller  <jeffm@apple.com>
3400
3401         Reviewed by Darin Adler.
3402
3403         WebKit2: Add APIs to WKBundleFrame to get content bounds and scroll offset
3404         https://bugs.webkit.org/show_bug.cgi?id=51968
3405
3406         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3407         (WKBundleFrameGetContentBounds):
3408         (WKBundleFrameGetScrollOffset):
3409         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
3410         Add WKBundleFrameGetContentBounds() and WKBundleFrameGetScrollOffset().
3411
3412 2011-01-06  James Robinson  <jamesr@chromium.org>
3413
3414         Reviewed by Simon Fraser.
3415
3416         Implement mozilla's animationTime property
3417         https://bugs.webkit.org/show_bug.cgi?id=51952
3418
3419         Tells the page to clear the current animation time after producing a frame.
3420
3421         * WebProcess/WebPage/WebPage.cpp:
3422         (WebKit::WebPage::drawRect):
3423         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
3424         (WebKit::ChunkedUpdateDrawingArea::display):
3425         (WebKit::ChunkedUpdateDrawingArea::setSize):
3426         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
3427         (WebKit::LayerBackedDrawingArea::syncCompositingLayers):
3428
3429 2011-01-06  Darin Adler  <darin@apple.com>
3430
3431         Redo the half-done rename from the last check-in.
3432         Sorry for the broken build last night.
3433
3434         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3435         (WebKit::WebBackForwardListProxy::removeItem): Renamed.
3436         * WebProcess/WebPage/WebBackForwardListProxy.h: Updated
3437         for new name.
3438         * WebProcess/WebPage/WebPage.cpp:
3439         (WebKit::WebPage::didRemoveBackForwardItem): Updated to
3440         use the new name.
3441
3442 2011-01-06  Maciej Stachowiak  <mjs@apple.com>
3443
3444         Rubber stamped by Dan Bernstein.
3445
3446         Fix build for Darin's previous change w/ the obvious renaming.
3447
3448         * WebProcess/WebPage/WebBackForwardListProxy.h:
3449         * WebProcess/WebPage/WebPage.cpp:
3450         (WebKit::WebPage::didRemoveBackForwardItem):
3451
3452 2011-01-05  Darin Adler  <darin@apple.com>
3453
3454         Reviewed by Geoff Garen.
3455
3456         Back/Forward entries in WebKit2 leak
3457         https://bugs.webkit.org/show_bug.cgi?id=51983
3458
3459         Besides fixing the leak, this also fixes a problem where
3460         all history items were sent over to the UI process, but
3461         we wanted to send only back/forward items.
3462
3463         * UIProcess/WebBackForwardList.cpp:
3464         (WebKit::WebBackForwardList::pageClosed): Added.
3465         Tells the web process about all the back/forward
3466         items being removed.
3467         (WebKit::WebBackForwardList::addItem): Ditto.
3468         Also removed a redundant call to didChangeBackForwardList.
3469         (WebKit::WebBackForwardList::clear): Ditto.
3470
3471         * UIProcess/WebBackForwardList.h: Added pageClosed.
3472
3473         * UIProcess/WebPageProxy.cpp:
3474         (WebKit::WebPageProxy::close): Added a call to pageClosed.
3475         (WebKit::WebPageProxy::backForwardRemovedItem): Added.
3476         Sends a message to the web page in the web process.
3477
3478         * UIProcess/WebPageProxy.h: Added backForwardRemovedItem.
3479
3480         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3481         (WebKit::updateBackForwardItem): Added an itemID argument,
3482         since callers will now be getting it and we don't want to
3483         get it twice. Removed the code to generate an ID. Also
3484         removed some local variables to make the code a little
3485         tighter and clearer.
3486         (WebKit::WK2NotifyHistoryItemChanged): Only call
3487         updateBackForwardItem for items that already have IDs.
3488         We don't want to send cross-process messages for every
3489         history item; just the ones that are top level back/forward
3490         items.
3491         (WebKit::WebBackForwardListProxy::removeItem):
3492         Added. For use when the UI process tells us to remove it.
3493         (WebKit::WebBackForwardListProxy::addItem): Added code to
3494         assign an ID and put this item into the maps. This is called
3495         exactly once on each back/forward item.
3496
3497         * WebProcess/WebPage/WebBackForwardListProxy.h: Added
3498         removeItem.
3499
3500         * WebProcess/WebPage/WebPage.cpp:
3501         (WebKit::WebPage::didRemoveBackForwardItem): Added.
3502
3503         * WebProcess/WebPage/WebPage.h: Added didRemoveBackForwardItem.
3504
3505         * WebProcess/WebPage/WebPage.messages.in: Added
3506         DidRemoveBackForwardItem message.
3507
3508 2011-01-05  Steve Falkenburg  <sfalken@apple.com>
3509
3510         Reviewed by Darin Adler.
3511
3512         Debug and Release builds on Windows clobber each other
3513         https://bugs.webkit.org/show_bug.cgi?id=49185
3514
3515         Changes the structure of WebKitBuild build products directory so we
3516         completely separate each build configuration into independent directories.
3517         
3518         Although we previously had per-configuration directories for obj, this change adds
3519         per-configuration directories for bin, lib, obj, and include. Each configuration's
3520         build products are stored within a directory inside of WebKitBuild.
3521         
3522         Most use of $(WebKitOutputDir) in the build files has been replaced by $(ConfigurationBuildDir),
3523         defined in common.vsprops to be $(WebKitOutputDir)\$(ConfigurationName).
3524
3525         * win/WebKit2.make:
3526         * win/WebKit2.vcproj:
3527         * win/WebKit2Common.vsprops:
3528         * win/WebKit2Generated.make:
3529         * win/WebKit2GeneratedCommon.vsprops:
3530         * win/WebKit2WebProcessPostBuild.cmd:
3531         * win/WebKit2WebProcessPreBuild.cmd:
3532         * win/WebKitPostBuild.cmd:
3533         * win/WebKitPreBuild.cmd:
3534
3535 2011-01-05  Alexey Proskuryakov  <ap@apple.com>
3536
3537         Reviewed by Anders Carlsson.
3538
3539         https://bugs.webkit.org/show_bug.cgi?id=51973
3540         Make main frame PDF printing work
3541
3542         * UIProcess/API/mac/PDFViewController.h:
3543         * UIProcess/API/mac/PDFViewController.mm: (WebKit::PDFViewController::makePrintOperation):
3544         Ask PDFDocument to create an NSPrintOperation.
3545
3546         * UIProcess/API/mac/WKView.h:
3547         * UIProcess/API/mac/WKView.mm:
3548         (-[WKView printOperationWithPrintInfo:forFrame:]): Create a new NSPrintOperation, either
3549         from scratch or from a PDF view.
3550         (-[WKView canPrintHeadersAndFooters]): Report if the view can be re-paginated to add headers
3551         and footers.
3552
3553 2011-01-05  Anders Carlsson  <andersca@apple.com>
3554
3555         Reviewed by Sam Weinig.
3556
3557         <rdar://problem/8750248>
3558         Need a way to create a new DownloadProxy from an arbitrary resource request
3559
3560         <rdar://problem/8750465>
3561         Need a way to start a download in WKDownload
3562         
3563         <rdar://problem/8752204>
3564         WK2 Context Menus - "Save linked file" support
3565
3566         * Shared/ContextMenuState.h: Added.
3567         Add a ContextMenuState struct which contains state for context menus.
3568
3569         * UIProcess/API/C/WKContext.cpp:
3570         (WKContextDownloadURLRequest):
3571         Call WebContext::download.
3572
3573         * UIProcess/WebContext.cpp:
3574         (WebKit::WebContext::download):
3575         Send a DownloadRequest message to the web process.
3576
3577         * UIProcess/WebPageProxy.cpp:
3578         (WebKit::WebPageProxy::showContextMenu):
3579         Set the active context menu state.
3580
3581         (WebKit::WebPageProxy::contextMenuItemSelected):
3582         Handle ContextMenuItemTagDownloadImageToDisk and ContextMenuItemTagDownloadLinkToDisk by calling
3583         WebContext::Download, passing the respective URLs.
3584
3585         * UIProcess/WebPageProxy.messages.in:
3586         ShowContextMenu now takes state as well.
3587
3588         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
3589         (WebKit::WebContextMenuClient::downloadURL):
3590         Assert that this is never reached; downloads are handled in the UI process.
3591
3592         * WebProcess/WebPage/WebContextMenu.cpp:
3593         (WebKit::WebContextMenu::show):
3594         Pass the context menu state along when sending the ShowContextMenu message.
3595
3596         * WebProcess/WebProcess.cpp:
3597         (WebKit::WebProcess::downloadRequest):
3598         Call the shared DownloadManager.
3599
3600         * WebProcess/WebProcess.messages.in:
3601         Add DownloadRequest message.
3602
3603         * WebKit2.xcodeproj/project.pbxproj:
3604         * win/WebKit2.vcproj:
3605         Add ContextMenuState.h.
3606
3607 2011-01-05  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
3608
3609         Unreviewed build fix.
3610
3611         [Qt] [Symbian] Fix building NPAPI support
3612
3613         NPEvent is mapped to QAction on Symbian. QAction has no
3614         default constructor, so toNP() fails to build. Add a case for
3615         Symbian behind the OS(SYMBIAN) guard.
3616
3617         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
3618         (WebKit::toNP):
3619
3620 2011-01-05  Jeff Miller  <jeffm@apple.com>
3621
3622         Reviewed by Dan Bernstein.
3623
3624         Copy WKImageCG.h to include\WebKit2 in build output
3625         https://bugs.webkit.org/show_bug.cgi?id=51944
3626
3627         * win/WebKit2Generated.make:
3628         Add xcopy command to copy WKImageCG.h.
3629
3630 2011-01-05  Brady Eidson  <beidson@apple.com>
3631
3632         Reviewed by Sam Weinig.
3633
3634         Part of <rdar://problem/8261624> and https://bugs.webkit.org/show_bug.cgi?id=47355
3635         Change WebKit2 session restoring to restore the full back/forward list
3636
3637         Add a new message to tell the WebProcess to restore a session state: