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