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