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