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