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