2011-02-09 Pavel Feldman <pfeldman@chromium.org>
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2011-02-09  Pavel Feldman  <pfeldman@chromium.org>
2
3         Reviewed by Yury Semikhatsky.
4
5         Web Inspector: follow up on InspectorAgent split -
6         removing unnecessary methods from InspectorController.
7         https://bugs.webkit.org/show_bug.cgi?id=54093
8
9         * WebProcess/WebPage/WebInspector.cpp:
10         (WebKit::WebInspector::showConsole):
11         (WebKit::WebInspector::stopJavaScriptProfiling):
12
13 2011-02-09  Alejandro G. Castro  <alex@igalia.com>
14
15         Reviewed by Martin Robinson.
16
17         [GTK] Avoid WebProcessMain compilation, we are used a gtk specific main
18         https://bugs.webkit.org/show_bug.cgi?id=54015
19
20         Avoided the compilation of the general WebProcessMain, and added
21         soup initialization to WebProcessMainGtk.cpp.
22
23         * GNUmakefile.am:
24         * WebProcess/gtk/WebProcessMainGtk.cpp:
25         (WebKit::WebProcessMainGtk):
26
27 2011-02-08  Alejandro G. Castro  <alex@igalia.com>
28
29         Reviewed by Martin Robinson.
30
31         [GTK] Incorrect assertion in WorkQueueGtk, we need to register
32         more than one handle
33         https://bugs.webkit.org/show_bug.cgi?id=54014
34
35         Fixed assertion condition we need to register more than one
36         handler for the same file descriptor.
37
38         * Platform/gtk/WorkQueueGtk.cpp:
39         (WorkQueue::registerEventSourceHandler):
40
41 2011-02-08  Alejandro G. Castro  <alex@igalia.com>
42
43         Reviewed by Martin Robinson.
44
45         Fix typo in the include guards name in ChunkedUpdateDrawingAreaProxy.h
46         https://bugs.webkit.org/show_bug.cgi?id=54013
47
48         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
49
50 2011-02-08  Alejandro G. Castro  <alex@igalia.com>
51
52         Reviewed by Martin Robinson.
53
54         [GTK] Fix after r77874, m_isConnected is initialized before the
55         socket is opened
56         https://bugs.webkit.org/show_bug.cgi?id=54011
57
58         Fixed connection breakage after r77874, we have to wait until open
59         the socket to open the connection.
60
61         * Platform/CoreIPC/gtk/ConnectionGtk.cpp:
62         (CoreIPC::Connection::platformInitialize):
63         (CoreIPC::Connection::open):
64
65 2011-02-08  Alejandro G. Castro  <alex@igalia.com>
66
67         Reviewed by Martin Robinson.
68
69         [WK2] LayerTreeContext is used outside the ACCELERATED_COMPOSITING
70         guards but not defined in DrawingAreaProxy.h
71         https://bugs.webkit.org/show_bug.cgi?id=54009
72
73         Removed the guards in the forward declaration, this will fail if
74         the class is finally used in the function, but it works for the
75         moment.
76
77         * UIProcess/DrawingAreaProxy.h:
78
79 2011-02-08  Alejandro G. Castro  <alex@igalia.com>
80
81         Reviewed by Martin Robinson.
82
83         WebKit2 GTK Fails to Build #include nested too deeply
84         https://bugs.webkit.org/show_bug.cgi?id=52219
85
86         * GNUmakefile.am: Removed the commands to create the directories
87         for the forwarding headers, the script already does it for us.
88         * config.h: Removed the config.h inclusion and added the
89         autotoolsconfig.h directly, also added a condition to share the
90         defines with QT.
91
92 2011-02-08  Maciej Stachowiak  <mjs@apple.com>
93
94         Reviewed by Mark Rowe.
95
96         Crash when going back/forward when back/forward list is in a bad state.
97         https://bugs.webkit.org/show_bug.cgi?id=54059
98         <rdar://problem/8975244>
99         
100         * UIProcess/WebPageProxy.cpp:
101         (WebKit::WebPageProxy::goForward): Add a null check.
102         (WebKit::WebPageProxy::goBack): ditto
103
104 2011-02-08  Anders Carlsson  <andersca@apple.com>
105
106         Reviewed by Beth Dakin.
107
108         Assertion failure !isInAcceleratedCompositingMode() in DrawingAreaProxyImpl::incorporateUpdate()
109         https://bugs.webkit.org/show_bug.cgi?id=54046
110         <rdar://problem/8973960>
111
112         DrawingAreaImpl::setRootCompositingLayer can be called with a new layer even when already
113         in accelerated compositing mode. Similarly, it can be called with a null layer even when not
114         in accelerated compositing mode. Make the drawing area and layer tree host handle both these cases.
115
116         * WebProcess/WebPage/DrawingAreaImpl.cpp:
117         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
118         Only call enterAcceleratedCompositingMode if there is no layer tree host, otherwise
119         just call LayerTreeHost::setRootCompositingLayer.
120
121         (WebKit::DrawingAreaImpl::setSize):
122         Add an assert.
123
124         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
125         Assert that we don't have a layer tree host.
126
127         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
128         Assert that we do have a layer tree host.
129
130         (WebKit::DrawingAreaImpl::display):
131         If the call to display caused the page to enter accelerated compositing mode, we don't
132         want to send back an Update message.
133
134         * WebProcess/WebPage/LayerTreeHost.cpp:
135         (WebKit::LayerTreeHost::create):
136         * WebProcess/WebPage/LayerTreeHost.h:
137         Create no longer takes a graphics layer.
138
139         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
140         (WebKit::LayerTreeHostMac::create):
141         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
142         Create no longer takes a graphics layer.
143         
144         (WebKit::LayerTreeHostMac::setRootCompositingLayer):
145         Set the new root compositing layer.
146
147 2011-02-08  Adam Roben  <aroben@apple.com>
148
149         Implement WorkQueue::scheduleWorkAfterDelay on Windows
150
151         Each WorkQueue now owns its own timer queue. When scheduleWorkAfterDelay is called, we
152         create a timer-queue timer with the given delay. When the timer fires, we schedule the work
153         on the queue and clean up the timer.
154
155         Fixes <http://webkit.org/b/54040> <rdar://problem/8974230> Web process sticks around forever
156         if it's hung when UI process goes away
157
158         Reviewed by Anders Carlsson.
159
160         * Platform/WorkQueue.h: Added timerCallback and m_timerQueue.
161
162         * Platform/win/WorkQueueWin.cpp:
163         (WorkQueue::platformInitialize): Initialize m_timerQueue.
164         (WorkQueue::platformInvalidate): Clean up m_timerQueue.
165         (TimerContext::TimerContext): Added this helper object to hold the context needed by the
166         timer callback.
167         (WorkQueue::timerCallback): Added. Schedules the WorkItem on the WorkQueue and cleans up the
168         timer.
169         (WorkQueue::scheduleWorkAfterDelay): Create a timer-queue timer on our timer queue that will
170         fire after the given delay. Pass a new TimerContext object to the timer callback that
171         contains the information it needs.
172
173 2011-02-08  Anders Carlsson  <andersca@apple.com>
174
175         Reviewed by Sam Weinig.
176
177         Rename PluginProcess::initializeConnection to PluginProcess::initialize
178         https://bugs.webkit.org/show_bug.cgi?id=54039
179
180         * PluginProcess/PluginProcess.cpp:
181         (WebKit::PluginProcess::initialize):
182         * PluginProcess/PluginProcess.h:
183         * PluginProcess/mac/PluginProcessMainMac.mm:
184         (WebKit::PluginProcessMain):
185         * WebProcess/WebProcess.h:
186
187 2011-02-08  Brady Eidson  <beidson@apple.com>
188
189         Reviewed by Darin Adler.
190
191         <rdar://problem/8972913> and https://bugs.webkit.org/show_bug.cgi?id=54036
192         didChangeBackForwardList should include some context about what changed
193
194         Update the implementation of this API to include the new item (if any) and removed items (if any):
195         * UIProcess/API/C/WKPage.h:
196         * UIProcess/WebLoaderClient.cpp:
197         (WebKit::WebLoaderClient::didChangeBackForwardList):
198         * UIProcess/WebLoaderClient.h:
199         * UIProcess/WebPageProxy.cpp:
200         (WebKit::WebPageProxy::didChangeBackForwardList):
201         * UIProcess/WebPageProxy.h:
202
203         Have WebBackForwardList pass the new items and/or removed items when calling the notifier:
204         * UIProcess/WebBackForwardList.cpp:
205         (WebKit::WebBackForwardList::addItem):
206         (WebKit::WebBackForwardList::goToItem):
207         (WebKit::WebBackForwardList::clear):
208
209 2011-02-08  Sam Weinig  <sam@webkit.org>
210
211         Reviewed by Anders Carlsson.
212
213         Sandbox violations visiting MobileMe.
214         <rdar://problem/8961330>
215
216         * WebProcess/com.apple.WebProcess.sb:
217
218 2011-02-08  Anders Carlsson  <andersca@apple.com>
219
220         Reviewed by Sam Weinig.
221
222         Rename PluginProcess::initialize to PluginProcess::initializePluginProcess
223         https://bugs.webkit.org/show_bug.cgi?id=54037
224
225         Rename PluginProcess::initialize to PluginProcess::initializePluginProcess to better
226         match the WebProcess initialization code, in preparation of sharing more code.
227
228         * PluginProcess/PluginProcess.cpp:
229         (WebKit::PluginProcess::initializePluginProcess):
230         * PluginProcess/PluginProcess.h:
231         * PluginProcess/PluginProcess.messages.in:
232         * UIProcess/Plugins/PluginProcessProxy.cpp:
233         (WebKit::PluginProcessProxy::didFinishLaunching):
234
235 2011-02-08  Sam Weinig  <sam@webkit.org>
236
237         Reviewed by Anders Carlsson.
238
239         WK2: Add ability to pass context to policy delegate methods
240         https://bugs.webkit.org/show_bug.cgi?id=54031
241
242         * Platform/CoreIPC/HandleMessage.h:
243         (CoreIPC::callMemberFunction):
244         (CoreIPC::handleMessageVariadic):
245         * Scripts/webkit2/messages.py:
246         Add ability to pass variadic messages to sync messages.
247
248         * Shared/API/c/WKBase.h:
249         * Shared/APIObject.h:
250         Add WKBundleNavigation type.
251
252         * UIProcess/API/C/WKPage.h:
253         * UIProcess/WebPageProxy.cpp:
254         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
255         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
256         (WebKit::WebPageProxy::decidePolicyForMIMEType):
257         * UIProcess/WebPageProxy.h:
258         * UIProcess/WebPageProxy.messages.in:
259         * UIProcess/WebPolicyClient.cpp:
260         (WebKit::WebPolicyClient::decidePolicyForNavigationAction):
261         (WebKit::WebPolicyClient::decidePolicyForNewWindowAction):
262         (WebKit::WebPolicyClient::decidePolicyForMIMEType):
263         * UIProcess/WebPolicyClient.h:
264         Update policy client for new data.
265
266         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
267         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp: Added.
268         (WKBundleNavigationActionGetTypeID):
269         (WKBundleNavigationActionGetNavigationType):
270         (WKBundleNavigationActionGetEventModifiers):
271         (WKBundleNavigationActionGetEventMouseButton):
272         (WKBundleNavigationActionCopyHitTestResult):
273         (WKBundleNavigationActionCopyFormElement):
274         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.h: Added.
275         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
276         (WKBundlePageSetPolicyClient):
277         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
278         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp: Added.
279         (WebKit::mouseEventForNavigationAction):
280         (WebKit::mouseButtonForMouseEvent):
281         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
282         (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
283         (WebKit::InjectedBundleNavigationAction::create):
284         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
285         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h: Added.
286         (WebKit::InjectedBundleNavigationAction::navigationType):
287         (WebKit::InjectedBundleNavigationAction::modifiers):
288         (WebKit::InjectedBundleNavigationAction::mouseButton):
289         (WebKit::InjectedBundleNavigationAction::hitTestResult):
290         (WebKit::InjectedBundleNavigationAction::formElement):
291         (WebKit::InjectedBundleNavigationAction::type):
292         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp: Added.
293         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNavigationAction):
294         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForNewWindowAction):
295         (WebKit::InjectedBundlePagePolicyClient::decidePolicyForMIMEType):
296         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h: Added.
297         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
298         (WebKit::WebChromeClient::createWindow):
299         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
300         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
301         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
302         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
303         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
304         * WebProcess/WebPage/WebPage.cpp:
305         (WebKit::WebPage::initializeInjectedBundlePolicyClient):
306         * WebProcess/WebPage/WebPage.h:
307         (WebKit::WebPage::injectedBundlePolicyClient):
308         Pipe the policy client through the bundle to allow setting user data.
309
310         * WebKit2.pro:
311         * WebKit2.xcodeproj/project.pbxproj:
312         * win/WebKit2.vcproj:
313         * win/WebKit2Generated.make:
314         Add new files.
315
316 2011-02-08  Anders Carlsson  <andersca@apple.com>
317
318         Reviewed by Sam Weinig.
319
320         Crash calling -setFrame:andScrollBy: in windowDidResize
321         https://bugs.webkit.org/show_bug.cgi?id=54030
322         <rdar://problem/8969760>
323
324         * Platform/mac/SharedMemoryMac.cpp:
325         (WebKit::SharedMemory::create):
326         Assert that size is not zero here; we never want to try to create shared memory with a zero size.
327         
328         * WebProcess/WebPage/DrawingAreaImpl.cpp:
329         (WebKit::DrawingAreaImpl::setSize):
330         Always invalidate the entire visible page when resizing.
331
332 2011-02-08  Adam Barth  <abarth@webkit.org>
333
334         Reviewed by Eric Seidel.
335
336         Remove orphan code from old parser
337         https://bugs.webkit.org/show_bug.cgi?id=53984
338
339         * WebProcess/WebCoreSupport/WebChromeClient.cpp
340         * WebProcess/WebCoreSupport/WebChromeClient.h
341
342 2011-02-08  Anders Carlsson  <andersca@apple.com>
343
344         Reviewed by Sam Weinig.
345
346         UI process crashes if web process crashes while web inspector is focused
347         https://bugs.webkit.org/show_bug.cgi?id=53965
348         <rdar://problem/8961633>
349
350         Make sure to close the web inspector web page proxy before calling platformClose, since 
351         platformClose can cause the web page proxy to try to send messages (such as SetActive) 
352         to the web process while it's in a bad state. 
353
354         The original fix, http://trac.webkit.org/changeset/77866, put the call to m_page->close() in
355         WebInspectorProxy::didClose, which was wrong and lead to crashes. The right place to close the page
356         is in WebInspectorProxy::invalidate.
357
358         * UIProcess/WebInspectorProxy.cpp:
359         (WebKit::WebInspectorProxy::invalidate):
360
361 2011-02-08  Jessie Berlin  <jberlin@apple.com>
362
363         Reviewed by Adam Roben.
364
365         ASSERTION FAILURE: ASSERT_NOT_REACHED() in Connection::writeEventHandler() after the Web
366         Process crashes.
367         https://bugs.webkit.org/show_bug.cgi?id=54005
368
369         * Platform/CoreIPC/win/ConnectionWin.cpp:
370         (CoreIPC::Connection::writeEventHandler):
371         Handle ERROR_BROKEN_PIPE by calling connectionDidClose() and returning early.
372
373 2011-02-08  Adam Roben  <aroben@apple.com>
374
375         Handle WM_TIMER messages for stopped timers
376
377         Whenever we stop a timer, we call ::KillTimer to cancel any future firings of the timer. But
378         ::KillTimer doesn't do anything about WM_TIMER messages that have already been posted to the
379         message queue. We need to handle those, too.
380
381         Fixes <http://webkit.org/b/53999> Occasional assertion failures in
382         RunLoop::TimerBase::timerFired
383
384         Reviewed by Darin Adler.
385
386         * Platform/win/RunLoopWin.cpp:
387         (RunLoop::TimerBase::timerFired): Just bail if the timer has already been stopped.
388
389 2011-02-08  Adam Roben  <aroben@apple.com>
390
391         Don't mark a Connection as connected until open() is called on Windows
392
393         This matches Mac. Even though the Connection's pipe is connected before open() is called,
394         the Connection itself isn't really connected to the pipe until then, and we won't actually
395         read any data from before that point.
396
397         Fixes <http://webkit.org/b/53998> <rdar://problem/8971207> REGRESSION (r77874): Assertion
398         failure on launch in Connection::setDidCloseOnConnectionWorkQueueCallback on Windows
399
400         Reviewed by Darin Adler.
401
402         * Platform/CoreIPC/win/ConnectionWin.cpp:
403         (CoreIPC::Connection::platformInitialize): Moved code to set m_isConnected from here to
404         open.
405         (CoreIPC::Connection::platformInvalidate): Unset m_isConnected, to match Mac. (This isn't
406         part of the bug fix, but seemed worthwhile.)
407         (CoreIPC::Connection::open): Set m_isConnected now that we're going to listen on the pipe.
408
409 2011-02-08  Sheriff Bot  <webkit.review.bot@gmail.com>
410
411         Unreviewed, rolling out r77866.
412         http://trac.webkit.org/changeset/77866
413         https://bugs.webkit.org/show_bug.cgi?id=53981
414
415         caused all WebKit2 inspector tests to crash (Requested by
416         othermaciej on #webkit).
417
418         * UIProcess/WebInspectorProxy.cpp:
419         (WebKit::WebInspectorProxy::didClose):
420
421 2011-02-07  Maciej Stachowiak  <mjs@apple.com>
422
423         Reviewed by Dan Bernstein.
424
425         Add resource load client for injected bundle and move willSendRequest there
426         https://bugs.webkit.org/show_bug.cgi?id=53972
427
428         * GNUmakefile.am:
429         * WebKit2.pro:
430         * WebKit2.xcodeproj/project.pbxproj:
431         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
432         (WKBundlePageSetPageLoaderClient):
433         (WKBundlePageSetResourceLoadClient):
434         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
435         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
436         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
437         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp: Added.
438         (WebKit::InjectedBundlePageResourceLoadClient::didInitiateLoadForResource):
439         (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame):
440         (WebKit::InjectedBundlePageResourceLoadClient::didReceiveResponseForResource):
441         (WebKit::InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource):
442         (WebKit::InjectedBundlePageResourceLoadClient::didFinishLoadForResource):
443         (WebKit::InjectedBundlePageResourceLoadClient::didFailLoadForResource):
444         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h: Added.
445         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
446         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
447         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
448         (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
449         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
450         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
451         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
452         * WebProcess/WebPage/WebPage.cpp:
453         (WebKit::WebPage::initializeInjectedBundleResourceLoadClient):
454         * WebProcess/WebPage/WebPage.h:
455         (WebKit::WebPage::injectedBundleResourceLoadClient):
456         * win/WebKit2.vcproj:
457
458 2011-02-07  Mark Rowe  <mrowe@apple.com>
459
460         Fix the 32-bit build.
461
462         * UIProcess/cf/WebBackForwardListCF.cpp:
463         (WebKit::WebBackForwardList::restoreFromCFDictionaryRepresentation): Add some casts
464         to prevent warnings about mixing signed and unsigned comparisons.
465
466 2011-02-07  Qi Zhang  <qi.2.zhang@nokia.com>
467
468         Reviewed by Andreas Kling.
469
470         [Qt] enum QWebPage::WebAction doesn't have value QWebPage::CopyImageUrl
471         https://bugs.webkit.org/show_bug.cgi?id=52974
472
473         Add ContextMenuItemTagCopyImageUrlToClipboard into standard action but Qt platform specific.
474
475         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
476         (WebKit::WebPlatformStrategies::contextMenuItemTagCopyImageUrlToClipboard):
477         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
478
479 2011-02-07  Enrica Casucci  <enrica@apple.com>
480
481         Reviewed by Sam Weinig.
482
483         Fixing a build break on Mac caused by http://trac.webkit.org/changeset/77874
484         
485         Removed unused static function.
486         
487         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
488
489 2011-02-07  Anders Carlsson  <andersca@apple.com>
490
491         Reviewed by Sam Weinig.
492
493         <rdar://problem/8969888> 
494         The WebProcess should set LSFileQuarantineEnabled to true
495
496         * WebProcess/Info.plist:
497
498 2011-02-07  Anders Carlsson  <andersca@apple.com>
499
500         Reviewed by Sam Weinig.
501
502         Crash in web process after the connection had been closed
503         https://bugs.webkit.org/show_bug.cgi?id=51115
504         <rdar://problem/8964255>
505
506         Remove didCloseOnConnectionWorkQueue from Connection::Client and add
507         Connection::setDidCloseOnConnectionWorkQueueCallback which takes a static
508         function, eliminating the race condition in connectionDidClose where m_client could be
509         nulled out in the client thread right before we try to dereference it.
510
511         * Platform/CoreIPC/Connection.cpp:
512         (CoreIPC::Connection::Connection):
513         Initialize m_didCloseOnConnectionWorkQueueCallback.
514
515         (CoreIPC::Connection::setDidCloseOnConnectionWorkQueueCallback):
516         Update m_didCloseOnConnectionWorkQueueCallback.
517
518         (CoreIPC::Connection::connectionDidClose):
519         Call m_didCloseOnConnectionWorkQueueCallback.
520
521         * Platform/WorkQueue.h:
522         Make WorkQueue noncopyable.
523
524         * PluginProcess/PluginProcess.cpp:
525         (WebKit::PluginProcess::initializeConnection):
526         Call setDidCloseOnConnectionWorkQueueCallback.
527
528         * Shared/ChildProcess.cpp:
529         (WebKit::ChildProcess::didCloseOnConnectionWorkQueue):
530         * Shared/ChildProcess.h:
531         didCloseOnConnectionWorkQueue is now a static member function.
532
533         * WebProcess/WebProcess.cpp:
534         (WebKit::WebProcess::initialize):
535         Call setDidCloseOnConnectionWorkQueueCallback.
536
537 2011-02-07  Enrica Casucci  <enrica@apple.com>
538
539         Reviewed Adam Roben and Darin Adler.
540
541         WebKit2: drag and drop support on Windows.
542         https://bugs.webkit.org/show_bug.cgi?id=52775
543         <rdar://problem/8514409>
544         
545         This patch contains the remaining work to support
546         a WebKit window as drag source on Windows.
547         I've added the code to generate the image for dragging a link as
548         well as the steps necessary to package the HBITMAP into a SharedMemory
549         object and send it over to the UI process where DoDragDrop is performed.
550
551         * UIProcess/WebPageProxy.cpp:
552         (WebKit::WebPageProxy::setDragImage):
553         (WebKit::WebPageProxy::startDragDrop):
554         * UIProcess/WebPageProxy.h:
555         * UIProcess/WebPageProxy.messages.in:
556         * WebProcess/WebCoreSupport/WebDragClient.cpp:
557         (WebKit::WebDragClient::startDrag): Made startDrag for
558         platforms other than Windows and Mac.
559         * WebProcess/WebCoreSupport/WebDragClient.h:
560         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
561         (WebKit::WebDragClient::startDrag):
562         * WebProcess/WebCoreSupport/win/WebDragClientWin.cpp: Added.
563         (WebKit::draggingSourceOperationMaskToDragCursors):
564         (WebKit::WebDragClient::startDrag):
565         * WebProcess/WebCoreSupport/win/WebDragSource.cpp: Added.
566         This object implements the IDropSource interface.
567         (WebDragSource::createInstance):
568         (WebDragSource::WebDragSource):
569         (WebDragSource::QueryInterface):
570         (WebDragSource::AddRef):
571         (WebDragSource::Release):
572         (WebDragSource::QueryContinueDrag):
573         (WebDragSource::GiveFeedback):
574         * WebProcess/WebCoreSupport/win/WebDragSource.h: Added.
575         * win/WebKit2.vcproj:
576
577 2011-02-07  Anders Carlsson  <andersca@apple.com>
578
579         Reviewed by Sam Weinig.
580
581         UI process crashes if web process crashes while web inspector is focused
582         https://bugs.webkit.org/show_bug.cgi?id=53965
583         <rdar://problem/8961633>
584
585         Make sure to close the web inspector web page proxy before calling platformClose, since
586         platformClose can cause the web page proxy to try to send messages (such as SetActive)
587         to the web process while it's in a bad state.
588
589         * UIProcess/WebInspectorProxy.cpp:
590         (WebKit::WebInspectorProxy::didClose):
591
592 2011-02-07  Anders Carlsson  <andersca@apple.com>
593
594         Reviewed by Darin Adler.
595
596         Find bouncy is missing content on pages with framesets
597         https://bugs.webkit.org/show_bug.cgi?id=53958
598         <rdar://problem/8904447>
599
600         Fix paint rect computation; FrameView::paint expects the paint rect to be in the
601         parent widget's coordinate system.
602
603         * WebProcess/WebPage/FindController.cpp:
604         (WebKit::FindController::updateFindIndicator):
605
606 2011-02-07  Brady Eidson  <beidson@apple.com>
607
608         Reviewed by Anders Carlsson.
609
610         <rdar://problem/8960434> and https://bugs.webkit.org/show_bug.cgi?id=53957
611         Crash after incorrectly restoring bogus session state.
612
613         In some cases we're writing an invalid session state for a back/forward list where the current entry is 0
614         but the number of entries is also 0.
615         In such cases the current entry should be "NoCurrentEntryIndex."
616
617         When we later read this state in, we set ourselves up to crash later.
618
619         Amusingly an ASSERT caught this, but we should've rejected it before the ASSERT fired.
620
621         * UIProcess/cf/WebBackForwardListCF.cpp:
622         (WebKit::WebBackForwardList::restoreFromCFDictionaryRepresentation): Fail the restore if the "current index past the end
623           of the list" case occurs, and speculatively bail out of the case where we have no current index but do have a list.
624           Also remove the unhelpful ASSERT.
625
626 2011-02-07  Sam Weinig  <sam@webkit.org>
627
628         Reviewed by Anders Carlsson.
629
630         Add bundle API to get the background color of a frame
631         <rdar://problem/8962670>
632         https://bugs.webkit.org/show_bug.cgi?id=53952
633
634         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
635         (WKBundleFrameGetBodyBackgroundColor):
636         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
637         Add API function.
638
639         * WebProcess/WebPage/WebFrame.cpp:
640         (WebKit::WebFrame::getDocumentBackgroundColor):
641         * WebProcess/WebPage/WebFrame.h:
642         Call down into the document to get either the body's, or if there is no body,
643         the root element's, background color.
644
645 2011-02-07  Sam Weinig  <sam@webkit.org>
646
647         Fix typo. vectical -> vertical.
648
649         * UIProcess/WebPageProxy.cpp:
650         (WebKit::WebPageProxy::didChangeScrollbarsForMainFrame):
651
652 2011-02-07  Sam Weinig  <sam@webkit.org>
653
654         Reviewed by Anders Carlsson.
655
656         Inform the UIProcess when main frame scrollbars change
657         <rdar://problem/8967496>
658         https://bugs.webkit.org/show_bug.cgi?id=53941
659
660         * UIProcess/API/C/WKPage.cpp:
661         (WKPageHasHorizontalScrollbar):
662         (WKPageHasVerticalScrollbar):
663         * UIProcess/API/C/WKPage.h:
664         Add API to query whether the main frame has scrollbars.
665
666         * UIProcess/WebPageProxy.cpp:
667         (WebKit::WebPageProxy::WebPageProxy):
668         (WebKit::WebPageProxy::close):
669         (WebKit::WebPageProxy::processDidCrash):
670         (WebKit::WebPageProxy::didChangeScrollbarsForMainFrame):
671         * UIProcess/WebPageProxy.h:
672         (WebKit::WebPageProxy::hasHorizontalScrollbar):
673         (WebKit::WebPageProxy::hasVerticalScrollbar):
674         Store/update main frame scrollbar state.
675
676         * UIProcess/WebPageProxy.messages.in:
677         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
678         (WebKit::WebChromeClient::contentsSizeChanged):
679         * WebProcess/WebCoreSupport/WebChromeClient.h:
680         (WebKit::WebChromeClient::WebChromeClient):
681         Post message when main frame scrollbar state changes.
682
683 2011-02-07  Anders Carlsson  <andersca@apple.com>
684
685         Reviewed by Sam Weinig.
686
687         Some content is not covered by Find-on-page overlay
688         https://bugs.webkit.org/show_bug.cgi?id=53937
689         <rdar://problem/8711353>
690
691         * WebProcess/WebPage/DrawingAreaImpl.cpp:
692         (WebKit::DrawingAreaImpl::didInstallPageOverlay):
693         Call LayerTreeHost::didInstallPageOverlay.
694
695         (WebKit::DrawingAreaImpl::didUninstallPageOverlay):
696         Call LayerTreeHost::didUninstallPageOverlay.
697
698         (WebKit::DrawingAreaImpl::setPageOverlayNeedsDisplay):
699         Call LayerTreeHost::setPageOverlayNeedsDisplay.
700
701         * WebProcess/WebPage/FindController.cpp:
702         (WebKit::FindController::drawRect):
703         Remove a bogus assertion.
704
705         * WebProcess/WebPage/LayerTreeHost.h:
706         Add new pure virtual member functions.
707
708         * WebProcess/WebPage/PageOverlay.cpp:
709         (WebKit::PageOverlay::setNeedsDisplay):
710         Call DrawingArea::setPageOverlayNeedsDisplay.
711
712         * WebProcess/WebPage/WebPage.cpp:
713         (WebKit::WebPage::installPageOverlay):
714         Make sure to call PageOverlay::setNeedsDisplay after the page overlay has been installed.
715     
716         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
717         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
718         Create the page overlay layer if needed.
719
720         (WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplay):
721         Invalidate the page overlay layer as well.
722
723         (WebKit::LayerTreeHostMac::sizeDidChange):
724         Resize the page overlay layer.
725
726         (WebKit::LayerTreeHostMac::didInstallPageOverlay):
727         Create the page overlay layer.
728
729         (WebKit::LayerTreeHostMac::didUninstallPageOverlay):
730         Destroy the page overlay layer.
731
732         (WebKit::LayerTreeHostMac::setPageOverlayNeedsDisplay):
733         Call setNeedsDisplay on the page overlay layer.
734
735         (WebKit::LayerTreeHostMac::paintContents):
736         Handle painting the page overlay layer.
737
738         (WebKit::LayerTreeHostMac::flushPendingLayerChanges):
739         Flush the page overlay layer changes as well.
740
741         (WebKit::LayerTreeHostMac::createPageOverlayLayer):
742         Create a layer and add it as a sublayer of the root layer.
743
744         (WebKit::LayerTreeHostMac::destroyPageOverlayLayer):
745         Destroy the page overlay layer.
746
747 2011-02-06  Adam Roben  <aroben@apple.com>
748
749         Make it possible to use DrawingAreaProxyImpl on Windows
750
751         It can be optionally turned on by setting the WEBKIT2_USE_NEW_DRAWING_AREA environment
752         variable. Turning it on by default is covered by <http://webkit.org/b/53805>.
753
754         Fixes <http://webkit.org/b/53879>.
755
756         Reviewed by Anders Carlsson.
757
758         * UIProcess/BackingStore.h: Add an m_bitmap member on Windows.
759
760         * UIProcess/win/BackingStoreWin.cpp:
761         (WebKit::BitmapDC::operator HDC):
762         (WebKit::BitmapDC::BitmapDC):
763         (WebKit::BitmapDC::~BitmapDC):
764         Added this helper class, which uses RAII to select a bitmap into a new memory DC.
765         (WebKit::BackingStore::paint): Wrap our bitmap in a BitmapDC and use ::BitBlt to copy the
766         specified rect into the destination DC.
767         (WebKit::createBitmap): New helper function, just creates a DIB section with the specified
768         size.
769         (WebKit::BackingStore::incorporateUpdate): Ported from BackingStoreMac.mm. It seems like
770         this code could be shared at some point.
771         (WebKit::BackingStore::scroll): Wrap our bitmap in a BitmapDC and use ::ScrollDC to scroll
772         the specified rect.
773
774         * UIProcess/win/WebView.cpp:
775         (WebKit::useNewDrawingArea): Added. Returns true if the WEBKIT2_USE_NEW_DRAWING_AREA
776         environment variable is set.
777         (WebKit::drawPageBackground): New helper function. Code came from onPaintEvent.
778         (WebKit::WebView::onPaintEvent): Ported from -[WKView drawRect:].
779         (WebKit::WebView::createDrawingAreaProxy): Create a DrawingAreaProxyImpl if we're using the
780         new drawing area.
781
782         (WebKit::WebView::enterAcceleratedCompositingMode):
783         (WebKit::WebView::exitAcceleratedCompositingMode):
784         (WebKit::WebView::pageDidEnterAcceleratedCompositing):
785         (WebKit::WebView::pageDidLeaveAcceleratedCompositing):
786         Added some assertions to make sure these are only called when expected. We don't expect
787         enter/exitAcceleratedCompositingMode to be called at all right now, because accelerated
788         compositing is turned off in WebKit2 on Windows.
789
790         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary): Ditto, and added a case for the
791         DrawingAreaInfo::Impl constant.
792
793 2011-02-07  Adam Roben  <aroben@apple.com>
794
795         Start compiling DrawingArea[Proxy]Impl and dependencies on Windows
796
797         Fixes <http://webkit.org/b/53875> WebKit2 on Windows should build DrawingArea[Proxy]Impl
798
799         Reviewed by Sam Weinig and Darin Adler.
800
801         * Platform/Region.cpp:
802         (WebKit::Region::Shape::shapeOperation): Initialize variable to avoid a bogus "potentially
803         uninitialized variable" warning.
804
805         * UIProcess/BackingStore.cpp: Removed #error for non-Mac platforms.
806
807         * UIProcess/BackingStore.h: Added a PlatformGraphicsContext typedef for Windows.
808
809         * UIProcess/DrawingAreaProxy.h:
810         * UIProcess/DrawingAreaProxyImpl.cpp:
811         * UIProcess/WebPageProxy.cpp:
812         (WebKit::WebPageProxy::didReceiveMessage):
813         Allow Windows to compile the new drawing area code.
814
815         * WebProcess/WebPage/DrawingArea.cpp:
816         (WebKit::DrawingArea::create): Allow creating a DrawingAreaImpl on Windows, too.
817
818         * WebProcess/WebPage/DrawingArea.h:
819         * WebProcess/WebPage/DrawingAreaImpl.cpp:
820         * WebProcess/WebPage/LayerTreeHost.cpp:
821         * WebProcess/WebPage/WebPage.cpp:
822         (WebKit::WebPage::didReceiveMessage):
823         Allow Windows to compile the new drawing area code.
824
825         * Shared/win/LayerTreeContextWin.cpp: Added.
826         * UIProcess/win/BackingStoreWin.cpp: Added.
827         Stubbed out these files.
828
829         * win/WebKit2.vcproj: Added new files.
830
831 2011-02-07  Anders Carlsson  <andersca@apple.com>
832
833         Reviewed by Dan Bernstein.
834
835         Rename some drawing area related member functions
836         https://bugs.webkit.org/show_bug.cgi?id=53935
837
838         * WebProcess/WebPage/DrawingArea.h:
839         (WebKit::DrawingArea::setPageOverlayNeedsDisplay):
840         * WebProcess/WebPage/DrawingAreaImpl.cpp:
841         (WebKit::DrawingAreaImpl::setNeedsDisplay):
842         (WebKit::DrawingAreaImpl::setPageOverlayNeedsDisplay):
843         * WebProcess/WebPage/DrawingAreaImpl.h:
844         * WebProcess/WebPage/LayerTreeHost.h:
845         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
846         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
847         (WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplay):
848         (WebKit::LayerTreeHostMac::scrollNonCompositedContents):
849
850 2011-02-07  Adam Roben  <aroben@apple.com>
851
852         Use the right calling convention when calling WebKitMain
853
854         Fixes <http://webkit.org/b/53923> REGRESSION (r77678): Crash on quit in web process in
855         wWinMain
856
857         Reviewed by Steve Falkenburg.
858
859         * win/MainWin.cpp:
860         (wWinMain): Use __cdecl instead of WINAPI (__stdcall) when calling WebKitMain, since that is
861         how that function is declared.
862
863 2011-02-07  Anders Carlsson  <andersca@apple.com>
864
865         Reviewed by Dan Bernstein.
866
867         The drawing area should be in charge of drawing the page overlay
868         https://bugs.webkit.org/show_bug.cgi?id=53927
869
870         * WebProcess/WebPage/DrawingArea.h:
871         (WebKit::DrawingArea::didInstallPageOverlay):
872         (WebKit::DrawingArea::didUninstallPageOverlay):
873         (WebKit::DrawingArea::setOverlayNeedsDisplay):
874         Add empty stubs.
875
876         * WebProcess/WebPage/DrawingAreaImpl.cpp:
877         (WebKit::DrawingAreaImpl::didInstallPageOverlay):
878         Add empty function. This will eventually ask the layer tree host to
879         create a GraphicsLayer for the page overlay.
880
881         (WebKit::DrawingAreaImpl::didUninstallPageOverlay):
882         Tell the page that it needs to be repainted.
883
884         (WebKit::DrawingAreaImpl::setOverlayNeedsDisplay):
885         Just call setNeedsDisplay for now.
886
887         (WebKit::DrawingAreaImpl::display):
888         Paint the page overlay too.
889
890         * WebProcess/WebPage/DrawingAreaImpl.h:
891         * WebProcess/WebPage/WebPage.cpp:
892         (WebKit::WebPage::drawRect):
893         Only call drawPageOverlay if we have an old drawing area.
894
895         (WebKit::WebPage::drawPageOverlay):
896         Draw the page overlay. Code moved here from WebPage::drawRect.
897
898         (WebKit::WebPage::installPageOverlay):
899         Call DrawingArea::installPageOverlay.
900
901         (WebKit::WebPage::uninstallPageOverlay):
902         Call DrawingArea::uninstallPageOverlay.
903
904         * WebProcess/WebPage/WebPage.h:
905         (WebKit::WebPage::hasPageOverlay):
906         Add getter.
907
908 2011-02-07  Anders Carlsson  <andersca@apple.com>
909
910         Reviewed by Sam Weinig.
911
912         Add WebPage::bounds and use it
913         https://bugs.webkit.org/show_bug.cgi?id=53926
914
915         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
916         (WebKit::ChunkedUpdateDrawingArea::resumePainting):
917         * WebProcess/WebPage/DrawingAreaImpl.cpp:
918         (WebKit::DrawingAreaImpl::resumePainting):
919         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
920         * WebProcess/WebPage/WebPage.h:
921         (WebKit::WebPage::bounds):
922
923 2011-02-07  Anders Carlsson  <andersca@apple.com>
924
925         Reviewed by Maciej Stachowiak.
926
927         Don't exclude overlay scrollers from the page overlay bounds
928         https://bugs.webkit.org/show_bug.cgi?id=53924
929
930         Don't subtract the scrollbars from the page overlay bounds if
931         overlay scrollers are enabled.
932
933         * WebProcess/WebPage/PageOverlay.cpp:
934         (WebKit::PageOverlay::bounds):
935
936 2011-02-07  Adam Roben  <aroben@apple.com>
937
938         Windows build fix after r77794
939
940         * win/WebKit2.def: Export WebCore symbols used by WebKitTestRunner.
941
942 2011-02-07  Maciej Stachowiak  <mjs@apple.com>
943
944         Reviewed by Antti Koivisto.
945
946         Add WKURLRequestCopyURL API (needed for tests and also generally useful)
947         https://bugs.webkit.org/show_bug.cgi?id=53909
948
949         * Shared/API/c/WKURLRequest.cpp:
950         (WKURLRequestCopyURL):
951         * Shared/API/c/WKURLRequest.h:
952         * Shared/WebURLRequest.h:
953         (WebKit::WebURLRequest::url):
954
955 2011-02-06  Ryosuke Niwa  <rniwa@webkit.org>
956
957         Unreviewed; speculative Qt build fix.
958
959         * WebKit2.pro:
960
961 2011-02-06  Ryosuke Niwa  <rniwa@webkit.org>
962
963         Reviewed by Darin Adler.
964
965         OwnArraryPtr.h uses deleteOwnedPtr but doesn’t include OwnPtrCommon.h
966         https://bugs.webkit.org/show_bug.cgi?id=52867
967
968         * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp:
969         (WebKit::NetscapePluginModule::getPluginInfo): Calls adoptArrayPtr.
970
971 2011-02-06  Benjamin Poulain  <ikipou@gmail.com>
972
973         Reviewed by Andreas Kling.
974
975         [Qt] WebKit does not build on Mac with WebKit 2
976         https://bugs.webkit.org/show_bug.cgi?id=53380
977
978         * Platform/CoreIPC/qt/ConnectionQt.cpp: Use fcntl() to set close on exec so
979         we do not rely on recent kernel.
980         (CoreIPC::Connection::readyReadHandler):
981         * Platform/qt/SharedMemoryQt.cpp: ditto
982         (WebKit::SharedMemory::create):
983         (WebKit::SharedMemory::createHandle):
984         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp: Guard prctl() since it is
985         a Linux specific function.
986         (WebKit::QtWebProcess::setupChildProcess):
987         * UIProcess/DrawingAreaProxy.h: Differentiate between building on Mac
988         and the Mac port.
989         * UIProcess/DrawingAreaProxyImpl.cpp: ditto
990         * UIProcess/WebPageProxy.cpp: ditto
991         (WebKit::WebPageProxy::didReceiveMessage):
992         * WebProcess/WebPage/DrawingArea.cpp: ditto
993         (WebKit::DrawingArea::create):
994         * WebProcess/WebPage/DrawingArea.h:
995         * WebProcess/WebPage/DrawingAreaImpl.cpp: ditto
996         * WebProcess/WebPage/WebPage.cpp: ditto
997         (WebKit::WebPage::didReceiveMessage):
998
999 2011-02-05  Maciej Stachowiak  <mjs@apple.com>
1000
1001         Reviewed by Dan Bernstein.
1002
1003         REGRESSION: New drawing area is causing some WebProcess crashes in layout tests
1004         https://bugs.webkit.org/show_bug.cgi?id=53865
1005         <rdar://problem/8963148>
1006         
1007         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1008         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): Handle the case
1009         where this is called repeatedly without exiting accelerated composting mode
1010         first.
1011         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Handle the case
1012         of being called more than once.
1013
1014 2011-02-05  Anders Carlsson  <andersca@apple.com>
1015
1016         Reviewed by Darin Adler.
1017
1018         Need a way to resize and scroll the page at the same time
1019         https://bugs.webkit.org/show_bug.cgi?id=53814
1020         <rdar://problem/8498008>
1021
1022         Add -[WKView setFrame:andScrollBy:].
1023
1024         * UIProcess/API/mac/WKView.h:
1025         * UIProcess/API/mac/WKView.mm:
1026         (-[WKView setFrame:andScrollBy:]):
1027         Stash away the scroll offset and call setFrame:.
1028
1029         (-[WKView _switchToDrawingAreaTypeIfNecessary:DrawingAreaInfo::]):
1030         (-[WKView _setDrawingAreaSize:]):
1031         * UIProcess/API/qt/qwkpage.cpp:
1032         (QWKPage::setViewportSize):
1033         DrawingAreaProxy::setSize now takes a scroll offset.
1034
1035         * UIProcess/DrawingAreaProxy.cpp:
1036         (WebKit::DrawingAreaProxy::setSize):
1037         This now takes a scroll offset and stores it in m_scrollOffset.
1038
1039         * UIProcess/DrawingAreaProxy.h:
1040         * UIProcess/DrawingAreaProxyImpl.cpp:
1041         (WebKit::DrawingAreaProxyImpl::sendSetSize):
1042         Send along the scroll offset and set it back to zero.
1043
1044         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
1045         (WebKit::LayerBackedDrawingAreaProxy::didSetSize):
1046         * UIProcess/TiledDrawingAreaProxy.cpp:
1047         (WebKit::TiledDrawingAreaProxy::didSetSize):
1048         * UIProcess/win/WebView.cpp:
1049         (WebKit::WebView::onSizeEvent):
1050         (WebKit::WebView::switchToDrawingAreaTypeIfNecessary):
1051         DrawingAreaProxy::setSize now takes a scroll offset.
1052         
1053         * WebProcess/WebPage/DrawingArea.h:
1054         (WebKit::DrawingArea::setSize):
1055         Add a scrollOffset parameter.
1056
1057         * WebProcess/WebPage/DrawingArea.messages.in:
1058         Add a scroll offset parameter to the SetSize message.
1059
1060         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1061         (WebKit::DrawingAreaImpl::setSize):
1062         Call WebPage::scrollMainFrameIfNotAtMaxScrollPosition.
1063
1064         * WebProcess/WebPage/DrawingAreaImpl.h:
1065         * WebProcess/WebPage/WebPage.cpp:
1066         (WebKit::WebPage::scrollMainFrameIfNotAtMaxScrollPosition):
1067         Compute a scroll offset and call setScrollPosition on the main frame view.
1068
1069 2011-02-04  Brian Weinstein  <bweinstein@apple.com>
1070
1071         Reviewed by Maciej Stachowiak.
1072
1073         WebKit2: Crash when InjectedBundlePageLoaderClient::willSendRequestForFrame returns a null WKURLRequestRef
1074         https://bugs.webkit.org/show_bug.cgi?id=53829
1075         
1076         Store the result of m_client.willSendRequestForFrame in a RefPtr, and null check it before
1077         calling resourceRequest() on it.
1078
1079         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1080         (WebKit::InjectedBundlePageLoaderClient::willSendRequestForFrame):
1081
1082 2011-02-04  Anders Carlsson  <andersca@apple.com>
1083
1084         Fix build.
1085
1086         * WebProcess/mac/WebProcessMac.mm:
1087
1088 2011-02-04  Anders Carlsson  <andersca@apple.com>
1089
1090         Reviewed by Mark Rowe.
1091
1092         Link opened in background tab fails to paint when activated if it completes loading before tab is selected
1093         https://bugs.webkit.org/show_bug.cgi?id=53827
1094         <rdar://problem/8962355>
1095
1096         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1097         (WebKit::DrawingAreaImpl::resumePainting):
1098         Invalidate the entire page.
1099
1100 2011-02-04  Anders Carlsson  <andersca@apple.com>
1101
1102         Reviewed by Sam Weinig.
1103
1104         Fix <rdar://problem/8961227> WebKit2 does not work with symlinked home directories.
1105
1106         * WebProcess/mac/WebProcessMac.mm:
1107         (WebKit::WebProcess::platformSetCacheModel):
1108         Don't adopt an autoreleased pointer, this would lead to a crash.
1109
1110         (WebKit::appendSandboxParameterPath):
1111         (WebKit::appendSandboxParameterConfPath):
1112         (WebKit::initializeSandbox):
1113         Clean up the sandbox parameter code and make sure that realpath is called for all parameters.
1114
1115 2011-02-04  Sam Weinig  <sam@webkit.org>
1116
1117         Reviewed by Mark Rowe.
1118
1119         Sandbox violations when visiting a site using HTTP authentication
1120         <rdar://problem/8951079> 
1121
1122         * WebProcess/com.apple.WebProcess.sb:
1123
1124 2011-02-04  Alexey Proskuryakov  <ap@apple.com>
1125
1126         Reviewed by Darin Adler.
1127
1128         https://bugs.webkit.org/show_bug.cgi?id=53823
1129         Print layout sometimes seen on screen
1130
1131         <rdar://problem/8948742> REGRESSION (WebKit2) - When I print a page, I visually see it re-layout
1132         <rdar://problem/8899389> REGRESSION(WebKit2): Wrong content can appear when print dialog is up
1133
1134         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setAutodisplay): Removed a
1135         branch that didn't do anything useful.
1136
1137         * UIProcess/API/mac/WKPrintingView.h:
1138         * UIProcess/API/mac/WKPrintingView.mm:
1139         (-[WKPrintingView _suspendAutodisplay]):
1140         (-[WKPrintingView _delayedResumeAutodisplayTimerFired]):
1141         (-[WKPrintingView _delayedResumeAutodisplay]):
1142         (-[WKPrintingView knowsPageRange:]):
1143         (-[WKPrintingView beginDocument]):
1144         (-[WKPrintingView endDocument]):
1145         When page setup changes, or when going from print preview to actual printing, AppKit calls
1146         -endDocument just to begin it again. Delay resuming autodisplay until the next run loop
1147         iteration.
1148
1149         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1150         (WebKit::WebChromeClient::invalidateContentsAndWindow):
1151         (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
1152         Tightened it up from other side - we should never send pixels to UI process while in
1153         printing mode. This is not 100% reliable, because relayout doesn't happen immediately,
1154         and we can still have print layout in screen mode - but it helps.
1155
1156 2011-02-04  Sam Weinig  <sam@webkit.org>
1157
1158         Reviewed by Mark Rowe.
1159
1160         Fix for <rdar://problem/8961580>.
1161         Work around for <rdar://problem/8957845>.
1162
1163         * WebProcess/com.apple.WebProcess.sb:
1164
1165 2011-02-04  Darin Adler  <darin@apple.com>
1166
1167         Reviewed by Dan Bernstein.
1168
1169         WebKit2 doesn't hide mouse pointer on keypress
1170         https://bugs.webkit.org/show_bug.cgi?id=53821
1171         rdar://problem/8630895
1172
1173         * UIProcess/PageClient.h: Renamed didNotHandleKeyEvent to
1174         doneWithKeyEvent and added a bool wasEventHandled argument.
1175         * UIProcess/WebPageProxy.cpp:
1176         (WebKit::WebPageProxy::didReceiveEvent): Changed code to call
1177         doneWithKeyEvent and call even if event was handled.
1178
1179         * UIProcess/API/mac/PageClientImpl.h: Updated for above change.
1180         * UIProcess/API/mac/PageClientImpl.mm:
1181         (WebKit::PageClientImpl::doneWithKeyEvent): Ditto. But also
1182         call [NSCursor setHiddenUntilMouseMoves:YES] when a key down
1183         event was handled. This matches what -[WebHTMLView keyDown:] does.
1184         * UIProcess/API/qt/qwkpage.cpp:
1185         (QWKPagePrivate::doneWithKeyEvent): Ditto.
1186         * UIProcess/API/qt/qwkpage_p.h: Ditto.
1187         * UIProcess/win/WebView.cpp:
1188         (WebKit::WebView::doneWithKeyEvent): Ditto.
1189         * UIProcess/win/WebView.h: Ditto.
1190
1191 2011-02-04  Steve Falkenburg  <sfalken@apple.com>
1192
1193         Reviewed by Adam Roben.
1194
1195         WebKit2 clients fail to launch on Windows if client exe is in a different directory from WebKit
1196         https://bugs.webkit.org/show_bug.cgi?id=53810
1197         <rdar://problem/8946085>
1198         
1199         If WebKit2WebProcess.exe is in a different directory from the client process, and that
1200         client process uses CreateProcess to launch WebKit2WebProcess, the DLL search path may
1201         end up excluding the directory containing WebKit. To address this, we use SetDllDirectory
1202         to explicitly include the WebKit directory in the DLL search path.
1203
1204         * win/MainWin.cpp:
1205         (wWinMain): Use SetDllDirectory and LoadLibrary to load WebKit.dll from WebKit2WebProcess.exe
1206         * win/WebKit2WebProcessCommon.vsprops: Don't link directly to WebKit. Link against shlwapi.
1207
1208 2011-02-04  Adam Roben  <aroben@apple.com>
1209
1210         Allow passing a null filter callback to WKPageCopySessionState
1211
1212         WebKit2 part of <http://webkit.org/b/53616> <rdar://problem/8949883>.
1213
1214         Reviewed by Sam Weinig.
1215
1216         * UIProcess/cf/WebBackForwardListCF.cpp:
1217         (WebKit::WebBackForwardList::createCFDictionaryRepresentation): Check if the filter is null
1218         before calling it.
1219
1220 2011-02-04  Brian Weinstein  <bweinstein@apple.com>
1221
1222         Reviewed by John Sullivan.
1223
1224         WebKit2: DidInitiateLoadForResource needs to know if the resource is being loaded by a committed or provisional frame
1225         https://bugs.webkit.org/show_bug.cgi?id=53794
1226         
1227         When we navigate from one page to another, there can be multiple subresource requests between when
1228         the new page has started its provisional load and when it has committed the load.
1229         
1230         There can be:
1231         
1232         - The main resource load of the provisional page
1233         - Synchronous XHR from the unload event of the loaded page.
1234         
1235         WebKit clients need to be able to differentiate between these loads.
1236
1237         * UIProcess/API/C/WKPage.h:
1238         * UIProcess/WebPageProxy.cpp:
1239         (WebKit::WebPageProxy::didInitiateLoadForResource): Pass whether or not the page is provisionally loading
1240             to the client.
1241         * UIProcess/WebPageProxy.h:
1242         * UIProcess/WebPageProxy.messages.in: Add a new parameter to DidInitiateLoadForResource.
1243         * UIProcess/WebResourceLoadClient.cpp:
1244         (WebKit::WebResourceLoadClient::didInitiateLoadForResource):  a new parameter to didInitiateLoadForResource.
1245         * UIProcess/WebResourceLoadClient.h:
1246         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1247         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Pass whether or not the page is currently
1248             in a provisional load (checked by seeing if the DocumentLoader matches the FrameLoader's provisionalDocumentLoader)
1249             to the UI Process.
1250
1251 2011-02-04  Anders Carlsson  <andersca@apple.com>
1252
1253         Reviewed by Mark Rowe.
1254
1255         Mac WebKit2 should use the new drawing area
1256         https://bugs.webkit.org/show_bug.cgi?id=53802
1257         <rdar://problem/7881419>
1258         <rdar://problem/7881447>
1259         <rdar://problem/8252632>
1260         <rdar://problem/8479422>
1261         <rdar://problem/8633813>
1262         <rdar://problem/8734512>
1263         <rdar://problem/8787660>
1264
1265         * UIProcess/API/mac/WKView.mm:
1266         (useNewDrawingArea):
1267         Return true. Eventually this function should be removed, but let's keep it for now so
1268         we can go back to the old drawing area if necessary.
1269
1270 2011-02-04  Maciej Stachowiak  <mjs@apple.com>
1271
1272         Reviewed by Anders Carlsson.
1273
1274         WebKit2: Crash in WebPageProxy::setPendingAPIRequestURL after web process crashed
1275         https://bugs.webkit.org/show_bug.cgi?id=53799
1276         <rdar://problem/8943956>
1277
1278         * UIProcess/WebPageProxy.cpp:
1279         (WebKit::WebPageProxy::reload):
1280
1281 2011-02-04  Anders Carlsson  <andersca@apple.com>
1282
1283         Reviewed by Maciej Stachowiak.
1284
1285         Fix a shared memory leak
1286         https://bugs.webkit.org/show_bug.cgi?id=53800
1287
1288         Move the send right representing the shared memory.
1289
1290         * Platform/mac/SharedMemoryMac.cpp:
1291         (WebKit::SharedMemory::Handle::encode):
1292
1293 2011-02-04  Brady Eidson  <beidson@apple.com>
1294
1295         Reviewed by Anders Carlsson.
1296
1297         <rdar://problem/8636239> and https://bugs.webkit.org/show_bug.cgi?id=53785
1298         WebKit2: Pages with dynamically inserted iframes can add extraneous back/forward items.
1299
1300         WebCore doesn't gracefully handle the case where the decidePolicyForNavigationAction callback
1301         does not occur synchronously. Let's make it synchronous.
1302
1303         Change WebPageProxy to handle this message reply synchronously:
1304         * UIProcess/WebPageProxy.cpp:
1305         (WebKit::WebPageProxy::WebPageProxy):
1306         (WebKit::WebPageProxy::receivedPolicyDecision):
1307         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1308         * UIProcess/WebPageProxy.h:
1309         * UIProcess/WebPageProxy.messages.in: Make the navigation policy action message be synchronous.
1310
1311         * Platform/CoreIPC/HandleMessage.h:
1312         (CoreIPC::callMemberFunction): Add a 6-argument varient 
1313
1314         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1315         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Send the message synchronously.
1316
1317 2011-02-04  Steve Falkenburg  <sfalken@apple.com>
1318
1319         Windows build fix.
1320         Correct prebuild build-stopping rule to allow project only rebuilds.
1321
1322         * win/WebKit2WebProcessPreBuild.cmd:
1323
1324 2011-02-04  Brian Weinstein  <bweinstein@apple.com>
1325
1326         Reviewed by Adam Roben.
1327
1328         Assertion failure in WebInspectorProxy::platformClose closing main window when inspecting a popup 
1329         window, or when running regression tests.
1330         https://bugs.webkit.org/show_bug.cgi?id=53798
1331         <rdar://problem/8814364>
1332         
1333         Only assert about the state of m_inspectorWindow and m_inspectorView if the inspector is visible.
1334         Also, only call ::DestroyWindow if the HWND is non-null, just to be safe.
1335
1336         * UIProcess/win/WebInspectorProxyWin.cpp:
1337         (WebKit::WebInspectorProxy::platformClose):
1338
1339 2011-02-04  Anders Carlsson  <andersca@apple.com>
1340
1341         Reviewed by Dan Bernstein.
1342
1343         Go out of accelerated compositing mode when the drawing area is destroyed
1344         https://bugs.webkit.org/show_bug.cgi?id=53788
1345
1346         This fixes a crash in the UI process if a web process crashes while in accelerated compositing mode.
1347
1348         * UIProcess/DrawingAreaProxyImpl.cpp:
1349         (WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl):
1350
1351 2011-02-03  Yury Semikhatsky  <yurys@chromium.org>
1352
1353         Reviewed by Pavel Feldman.
1354
1355         Web Inspector: remove settings related methods from InspectorClient
1356         https://bugs.webkit.org/show_bug.cgi?id=53686
1357
1358         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
1359         (WebKit::WebInspectorFrontendClient::WebInspectorFrontendClient):
1360
1361 2011-02-03  Maciej Stachowiak  <mjs@apple.com>
1362
1363         Reviewed by Dan Bernstein.
1364
1365         WebKit2: Need WebKit2 equivalent of WebResourceLoadDelegate::willSendRequest in the Bundle
1366         https://bugs.webkit.org/show_bug.cgi?id=52897
1367         <rdar://problem/8898294>
1368
1369         * Shared/API/c/WKSharedAPICast.h:
1370         (WebKit::toAPI):
1371         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1372         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1373         (WebKit::InjectedBundlePageLoaderClient::willSendRequestForFrame):
1374         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1375         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1376         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
1377
1378 2011-02-03  Ivan Krstić  <ike@apple.com>
1379
1380         Reviewed by Maciej Stachowiak.
1381
1382         Make WebProcess pass explicit homedir parameter to the sandbox
1383         <rdar://problem/8405760>
1384         <https://webkit.org/b/53558>
1385
1386         * WebProcess/com.apple.WebProcess.sb:
1387         * WebProcess/mac/WebProcessMac.mm:
1388         (WebKit::initializeSandbox):
1389
1390 2011-02-03  James Kozianski  <koz@chromium.org>
1391
1392         Reviewed by Dimitri Glazkov.
1393
1394         Add navigator.registerProtocolHandler behind a flag.
1395         https://bugs.webkit.org/show_bug.cgi?id=52609
1396
1397         * Configurations/FeatureDefines.xcconfig:
1398
1399 2011-02-03  Adam Langley  <agl@chromium.org>
1400
1401         Reviewed by Adam Barth.
1402
1403         Plumb mixed script URL to FrameLoaderClient
1404         https://bugs.webkit.org/show_bug.cgi?id=52384
1405
1406         Regressions covered by http/tests/security/mixedContent/*
1407
1408         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1409         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
1410         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1411
1412 2011-02-03  Jon Honeycutt  <jhoneycutt@apple.com>
1413
1414         Download bundles should be moved to their final destination when they
1415         finish.
1416
1417         https://bugs.webkit.org/show_bug.cgi?id=53668
1418
1419         Reviewed by Adam Roben.
1420
1421         * WebProcess/Downloads/Download.cpp:
1422         (WebKit::Download::Download):
1423         Initialize m_allowOverwrite.
1424         (WebKit::Download::retrieveDestinationWithSuggestedFilename):
1425         Return the result of requesting the destination filename from the UI
1426         process.
1427         (WebKit::Download::decideDestinationWithSuggestedFilename):
1428         Call retrieveDestinationWithSuggestedFilename().
1429         (WebKit::Download::didFinish):
1430         Call platformDidFinish().
1431
1432         * WebProcess/Downloads/Download.h:
1433         Declare retrieveDestinationWithSuggestedFilename() and
1434         platformDidFinish(). Add a member variable to store whether the UI
1435         process would like us to overwrite existing files.
1436
1437         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
1438         (WebKit::willResumeWithResponseCallback):
1439         Remove some trailing whitespace.
1440
1441         * WebProcess/Downloads/curl/DownloadCurl.cpp:
1442         (WebKit::Download::platformDidFinish):
1443         Stubbed.
1444
1445         * WebProcess/Downloads/mac/DownloadMac.mm:
1446         (WebKit::Download::platformDidFinish):
1447         Stubbed.
1448
1449         * WebProcess/Downloads/qt/DownloadQt.cpp:
1450         (WebKit::Download::platformDidFinish):
1451         Stubbed.
1452
1453         * WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp:
1454         (WebKit::Download::didDecideDestination):
1455         Store whether the UI process would like us to overwrite existing files.
1456         (WebKit::Download::platformDidFinish):
1457         Try to move the bundle to the final destination. If that fails, ask the
1458         UI process for a new destination. If we receive one, try again to move
1459         the bundle. Call didCreateDestination() to report the updated path of
1460         file whether it's the bundle that we failed to move, or the new final
1461         destination.
1462
1463         This is similar to what is done by WebKit 1's CFNetwork port.
1464
1465         * win/WebKit2.vcproj:
1466         Add DownloadWin.cpp.
1467
1468 2011-02-01  Jon Honeycutt  <jhoneycutt@apple.com>
1469
1470         Small clean-up in DownloadCFNet.cpp.
1471
1472         Rubber-stamped by Mark Rowe.
1473
1474         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
1475         (WebKit::Download::didDecideDestination):
1476         Moved out of the section labeled "CFURLDownload callbacks" and up near
1477         the other member functions.
1478
1479 2011-02-03  Anders Carlsson  <andersca@apple.com>
1480
1481         Reviewed by Sam Weinig.
1482
1483         Paint non-composited contents in a layer
1484         https://bugs.webkit.org/show_bug.cgi?id=53742
1485
1486         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1487         (WebKit::DrawingAreaImpl::setNeedsDisplay):
1488         Call LayerTreeHost::setNonCompositedContentsNeedDisplayInRect.
1489
1490         (WebKit::DrawingAreaImpl::scroll):
1491         Call LayerTreeHost::scrollNonCompositedContents.
1492
1493         (WebKit::DrawingAreaImpl::setSize):
1494         Call LayerTreeHost::sizeDidChange.
1495
1496         * WebProcess/WebPage/LayerTreeHost.h:
1497         Add new pure virtual member functions.
1498
1499         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1500         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
1501         Create the non-composited content layer.
1502
1503         (WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplayInRect):
1504         Call setNeedsDisplay on the GraphicsLayer.
1505
1506         (WebKit::LayerTreeHostMac::scrollNonCompositedContents):
1507         Just call setNonCompositedContentsNeedDisplayInRect.
1508
1509         (WebKit::LayerTreeHostMac::sizeDidChange):
1510         Resize the layers and flush any changes.
1511         
1512         (WebKit::LayerTreeHostMac::paintContents):
1513         Call WebPage::drawRect.
1514
1515         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
1516         Lay out the web page.
1517
1518         (WebKit::LayerTreeHostMac::flushPendingLayerChanges):
1519         Call syncCompositingStateForThisLayerOnly on the non-composited content layer.
1520
1521 2011-02-03  Anders Carlsson  <andersca@apple.com>
1522
1523         Reviewed by Sam Weinig.
1524
1525         When in accelerated compositing mode, wait for DidSetSize messages
1526         https://bugs.webkit.org/show_bug.cgi?id=53736
1527
1528         Normally we wait for DidSetSize messages from ::paint, but that's never called in 
1529         accelerated compositing mode so we just do it right after sending the SetSize message.
1530
1531         * UIProcess/DrawingAreaProxyImpl.cpp:
1532         (WebKit::DrawingAreaProxyImpl::paint):
1533         Call waitForAndDispatchDidSetSize.
1534
1535         (WebKit::DrawingAreaProxyImpl::sendSetSize):
1536         Call waitForAndDispatchDidSetSize when in accelerated compositing mode.
1537
1538         (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidSetSize):
1539         New utility function which waits for and dispatches a DidSetSize message.
1540
1541         * UIProcess/DrawingAreaProxyImpl.h:
1542
1543 2011-02-03  Anders Carlsson  <andersca@apple.com>
1544
1545         Reviewed by Dan Bernstein.
1546
1547         Pass along an UpdateInfo object to the ExitAcceleratedCompositingMode message
1548         https://bugs.webkit.org/show_bug.cgi?id=53734
1549
1550         * UIProcess/DrawingAreaProxy.h:
1551         (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
1552         Add an UpdateInfo parameter.
1553
1554         * UIProcess/DrawingAreaProxy.messages.in:
1555         Add an UpdateInfo parameter to the ExitAcceleratedCompositingMode message.
1556
1557         * UIProcess/DrawingAreaProxyImpl.cpp:
1558         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
1559         Incorporate the passed in update.
1560
1561         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1562         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
1563         Create a new UpdateInfo object, paint into it and pass it along as a parameter
1564         to the ExitAcceleratedCompositingMode message.
1565
1566 2011-02-03  Beth Dakin  <bdakin@apple.com>
1567
1568         Reviewed by Sam Weinig.
1569
1570         Fix for <rdar://problem/8944544> Ability to animate track
1571         for WKPainter scrollers
1572
1573         * WebCoreSupport/WebSystemInterface.mm:
1574         (InitWebCoreSystemInterface):
1575
1576 2011-02-03  Anders Carlsson  <andersca@apple.com>
1577
1578         Reviewed by Dan Bernstein.
1579
1580         Change DidSetSize to take a LayerTreeContext parameter
1581         https://bugs.webkit.org/show_bug.cgi?id=53724
1582
1583         Since SetSize can cause layout to happen, we need to pass along a layer tree context to 
1584         the DidSetSize message so the UI process can enter/exit accelerated compositing mode appropriately.
1585         
1586         * Shared/LayerTreeContext.h:
1587         * Shared/mac/LayerTreeContextMac.mm:
1588         Add equality operators to LayerTreeContext.
1589
1590         * UIProcess/DrawingAreaProxy.h:
1591         (WebKit::DrawingAreaProxy::didSetSize):
1592         This now takes a LayerTreeContext parameter.
1593         
1594         * UIProcess/DrawingAreaProxy.messages.in:
1595         Add LayerTreeContext parameter.
1596
1597         * UIProcess/DrawingAreaProxyImpl.cpp:
1598         Get rid of m_isInAcceleratedCompositingMode and use the current layer context instead.
1599
1600         (WebKit::DrawingAreaProxyImpl::paint):
1601         Bail if the call to DidSetSize ended up entering accelerated compositing mode.
1602
1603         (WebKit::DrawingAreaProxyImpl::didSetSize):
1604         If the new layer tree context is different, enter/exit accelerated compositing mode accordingly.
1605
1606         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
1607         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
1608         Update the layer tree context.
1609
1610         * UIProcess/DrawingAreaProxyImpl.h:
1611         (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode):
1612         Add simple getter.
1613
1614         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1615         (WebKit::DrawingAreaImpl::setSize):
1616         Pass along the layer tree context.
1617
1618 2011-02-03  Anders Carlsson  <andersca@apple.com>
1619
1620         Reviewed by Dan Bernstein.
1621
1622         Get rid of LayerTreeContext::seed on Mac.
1623         Add sequence checks to enterAcceleratedCompositingMode and exitAcceleratedCompositingMode and
1624         have them call newly added overloads that don't have the checks.
1625
1626         * Shared/LayerTreeContext.h:
1627         * Shared/mac/LayerTreeContextMac.mm:
1628         (WebKit::LayerTreeContext::LayerTreeContext):
1629         (WebKit::LayerTreeContext::encode):
1630         (WebKit::LayerTreeContext::decode):
1631         * UIProcess/DrawingAreaProxyImpl.cpp:
1632         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
1633         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
1634         * UIProcess/DrawingAreaProxyImpl.h:
1635         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1636         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
1637
1638 2011-02-03  Anders Carlsson  <andersca@apple.com>
1639
1640         Reviewed by Dan Bernstein.
1641
1642         Get rid of timestamps in UpdateInfo
1643         https://bugs.webkit.org/show_bug.cgi?id=53713
1644
1645         Add a 64-bit sequence number to all DrawingAreaProxy messages, and use it to
1646         check whether Update messages should be handled or not.
1647
1648         * Shared/UpdateInfo.cpp:
1649         (WebKit::UpdateInfo::encode):
1650         (WebKit::UpdateInfo::decode):
1651         * Shared/UpdateInfo.h:
1652         (WebKit::UpdateInfo::UpdateInfo):
1653         * UIProcess/BackingStore.cpp:
1654         (WebKit::BackingStore::BackingStore):
1655         (WebKit::BackingStore::incorporateUpdate):
1656         * UIProcess/BackingStore.h:
1657         * UIProcess/DrawingAreaProxy.h:
1658         (WebKit::DrawingAreaProxy::update):
1659         (WebKit::DrawingAreaProxy::didSetSize):
1660         (WebKit::DrawingAreaProxy::enterAcceleratedCompositingMode):
1661         (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
1662         * UIProcess/DrawingAreaProxy.messages.in:
1663         * UIProcess/DrawingAreaProxyImpl.cpp:
1664         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
1665         (WebKit::DrawingAreaProxyImpl::update):
1666         (WebKit::DrawingAreaProxyImpl::didSetSize):
1667         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
1668         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
1669         * UIProcess/DrawingAreaProxyImpl.h:
1670         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1671         (WebKit::generateSequenceNumber):
1672         (WebKit::DrawingAreaImpl::setSize):
1673         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
1674         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
1675         (WebKit::DrawingAreaImpl::display):
1676
1677 2011-02-03  Anders Carlsson  <andersca@apple.com>
1678
1679         Reviewed by Darin Adler.
1680
1681         Don't send enter/exit accelerated compositing mode messages when handling setSize
1682         https://bugs.webkit.org/show_bug.cgi?id=53706
1683
1684         Don't send EnterAcceleratedCompositingMode/ExitAcceleratedCompositing mode when
1685         the mode changes happen as a result of relayout in setSize, since an updated state
1686         is going to be sent back in the DidSetSize message.
1687         
1688         * UIProcess/DrawingAreaProxyImpl.cpp:
1689         (WebKit::DrawingAreaProxyImpl::didSetSize):
1690         Add an assert.
1691
1692         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1693         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
1694         Initialize m_inSetSize.
1695
1696         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
1697         Factor out code into enterAcceleratedCompositingMode and exitAcceleratedCompositingMode.
1698
1699         (WebKit::DrawingAreaImpl::setSize):
1700         Set m_inSetSize to true while handling setSize.
1701
1702         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
1703         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
1704         Take over the message sending responsibility from LayerTreeHostMac, and don't send messages
1705         if we're currently handling a SetSize message.
1706
1707         * WebProcess/WebPage/DrawingAreaImpl.h:
1708         Add m_inSetSize.
1709
1710         * WebProcess/WebPage/LayerTreeHost.h:
1711         Add layerTreeHost getter.
1712
1713         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
1714         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1715         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
1716         Don't send EnterAcceleratedCompositingMode messages.
1717
1718         (WebKit::LayerTreeHostMac::layerTreeContext):
1719         Add getter for the current layer tree context.
1720
1721         (WebKit::LayerTreeHostMac::invalidate):
1722         Don't send ExitAcceleratedCompositingMode messages.
1723
1724 2011-02-03  Anders Carlsson  <andersca@apple.com>
1725
1726         Reviewed by Sam Weinig.
1727
1728         Make the layer tree host keep track of the layer tree context
1729         https://bugs.webkit.org/show_bug.cgi?id=53698
1730
1731         Add a LayerTreeContext member variable to the LayerTreeHost object,
1732         and also add a seed count to the LayerTreeContext so we can keep track of 
1733         how layer tree contexts relate to each other.
1734
1735         * Shared/LayerTreeContext.h:
1736         * Shared/mac/LayerTreeContextMac.mm:
1737         (WebKit::LayerTreeContext::LayerTreeContext):
1738         (WebKit::LayerTreeContext::makeWithSeed):
1739         (WebKit::LayerTreeContext::encode):
1740         (WebKit::LayerTreeContext::decode):
1741
1742         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
1743         Add the layer tree context as a member variable.
1744
1745         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1746         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
1747         Initialize the layer tree context.
1748
1749 2011-02-03  Sam Weinig  <sam@webkit.org>
1750
1751         Fix Qt build.
1752
1753         * UIProcess/API/qt/qwkpage.cpp:
1754         (QWKPage::QWKPage):
1755
1756 2011-02-02  Sam Weinig  <sam@webkit.org>
1757
1758         Reviewed by Anders Carlsson.
1759
1760         Add notification of the end of a rubber band.
1761         <rdar://problem/8940648>
1762
1763         * UIProcess/API/C/WKPage.h:
1764         * UIProcess/WebPageProxy.cpp:
1765         (WebKit::WebPageProxy::drawHeader):
1766         (WebKit::WebPageProxy::drawFooter):
1767         (WebKit::WebPageProxy::didCompleteRubberBandForMainFrame):
1768         * UIProcess/WebPageProxy.h:
1769         * UIProcess/WebPageProxy.messages.in:
1770         * UIProcess/WebUIClient.cpp:
1771         (WebKit::WebUIClient::didCompleteRubberBandForMainFrame):
1772         * UIProcess/WebUIClient.h:
1773         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1774         (WebKit::WebChromeClient::didCompleteRubberBandForMainFrame):
1775         * WebProcess/WebCoreSupport/WebChromeClient.h:
1776         Pipe the notification up to the WKUIClient.
1777
1778 2011-02-03  Sheriff Bot  <webkit.review.bot@gmail.com>
1779
1780         Unreviewed, rolling out r77449.
1781         http://trac.webkit.org/changeset/77449
1782         https://bugs.webkit.org/show_bug.cgi?id=53663
1783
1784         causes many WebKit2 tests to crash (Requested by othermaciej
1785         on #webkit).
1786
1787         * Shared/API/c/WKSharedAPICast.h:
1788         (WebKit::toAPI):
1789         (WebKit::toCopiedAPI):
1790         (WebKit::toURLRef):
1791         (WebKit::toCopiedURLAPI):
1792         * Shared/WebString.h:
1793         (WebKit::WebString::isNull):
1794         (WebKit::WebString::WebString):
1795
1796 2011-02-02  Sam Weinig  <sam@webkit.org>
1797
1798         Fix license block issues pointed out by Daniel Bates.
1799
1800         * Shared/API/c/WKGraphicsContext.cpp:
1801         * Shared/API/c/WKGraphicsContext.h:
1802         * Shared/API/c/cg/WKGraphicsContextCG.cpp:
1803         * Shared/API/c/cg/WKGraphicsContextCG.h:
1804         * Shared/WebGraphicsContext.cpp:
1805
1806 2011-02-02  Sam Weinig  <sam@webkit.org>
1807
1808         Reviewed by Dan Bernstein.
1809
1810         Add WKBundleFrameGetVisibleContentBoundsExcludingScrollbars API for WebKit2.
1811
1812         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1813         (WKBundleFrameGetContentBounds):
1814         (WKBundleFrameGetVisibleContentBounds):
1815         (WKBundleFrameGetVisibleContentBoundsExcludingScrollbars):
1816         (WKBundleFrameGetScrollOffset):
1817         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
1818         * WebProcess/WebPage/WebFrame.cpp:
1819         (WebKit::WebFrame::contentBounds):
1820         (WebKit::WebFrame::visibleContentBounds):
1821         (WebKit::WebFrame::visibleContentBoundsExcludingScrollbars):
1822         (WebKit::WebFrame::scrollOffset):
1823         * WebProcess/WebPage/WebFrame.h:
1824         Move implementation of frame geometry to the implementation file
1825         instead of keeping it in the API file.
1826
1827 2011-02-02  Stephanie Lewis  <slewis@apple.com>
1828
1829         Reviewed by Geoff Garen.
1830
1831         https://bugs.webkit.org/show_bug.cgi?id=53361
1832         <rdar://problem/8921729> REGRESSION: Membuster accumulates 1GB+ memory due to autorelease 
1833         pools not being drained.
1834         Call into AppKit to add observers that push and pop autorelease pools on entry 
1835         and exit from the CFRunLoop.  This will prevent memory from accumulating.
1836
1837         * WebProcess/mac/WebProcessMainMac.mm:
1838         (WebKit::WebProcessMain):
1839
1840 2011-02-02  Darin Adler  <darin@apple.com>
1841
1842         Reviewed by Sam Weinig.
1843
1844         Make null WTF::String objects turn into 0 pointers for WKStringRef and WKURLRef.
1845         rdar://problem/8948688
1846
1847         * Shared/API/c/WKSharedAPICast.h:
1848         (WebKit::toAPI): Return 0 if the passed in string is 0.
1849         (WebKit::toCopiedAPI): Ditto.
1850         (WebKit::toURLRef): Ditto. Old code was trying to do this but was missing a return.
1851         (WebKit::toCopiedURLAPI): Ditto. Old code was trying to do this but had incorrect
1852         nll check.
1853
1854         * Shared/WebString.h: Removed isNull function. It can never return true.
1855         Removed constructor code that turns the null string into the empty string.
1856         Instead assert that the passed in string is not null.
1857
1858 2011-02-02  Mark Rowe  <mrowe@apple.com>
1859
1860         Reviewed by Beth Dakin.
1861
1862         <rdar://problem/8928367> Crash when loading canvas pages inside HTMLCanvasElement::createImageBuffer().
1863
1864         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1865         (InitWebCoreSystemInterface): Add some missing initializers.
1866
1867 2011-02-02  Sam Weinig  <sam@webkit.org>
1868
1869         Reviewed by Beth Dakin.
1870
1871         Add ChromeClient function to paint custom overhang areas.
1872         https://bugs.webkit.org/show_bug.cgi?id=53639
1873
1874         * Shared/API/c/WKBase.h:
1875         * Shared/API/c/WKGraphicsContext.cpp: Added.
1876         (WKGraphicsContextGetTypeID):
1877         * Shared/API/c/WKGraphicsContext.h: Added.
1878         * Shared/API/c/WKSharedAPICast.h:
1879         * Shared/API/c/cg/WKGraphicsContextCG.cpp: Added.
1880         (WKGraphicsContextGetCGContext):
1881         * Shared/API/c/cg/WKGraphicsContextCG.h: Added.
1882         * Shared/APIObject.h:
1883         * Shared/WebGraphicsContext.cpp: Added.
1884         (WebKit::WebGraphicsContext::WebGraphicsContext):
1885         * Shared/WebGraphicsContext.h: Added.
1886         (WebKit::WebGraphicsContext::create):
1887         (WebKit::WebGraphicsContext::platformContext):
1888         (WebKit::WebGraphicsContext::type):
1889         Add WebGraphicsContext API type.
1890
1891         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1892         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
1893         (WebKit::InjectedBundlePageUIClient::pageDidScroll):
1894         (WebKit::InjectedBundlePageUIClient::shouldPaintCustomOverhangArea):
1895         (WebKit::InjectedBundlePageUIClient::paintCustomOverhangArea):
1896         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
1897         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1898         (WebKit::WebChromeClient::paintCustomOverhangArea):
1899         * WebProcess/WebCoreSupport/WebChromeClient.h:
1900         Pipe paintCustomOverhangArea to the InjectedBundlePageUIClient.
1901
1902         * UIProcess/API/C/WebKit2.h:
1903         * WebKit2.pro:
1904         * WebKit2.xcodeproj/project.pbxproj:
1905         * win/WebKit2.vcproj:
1906         * win/WebKit2Generated.make:
1907         Add new files.
1908
1909 2011-02-02  Anders Carlsson  <andersca@apple.com>
1910
1911         Reviewed by Dan Bernstein.
1912
1913         Work towards making the layer tree host be in charge of all painting
1914         https://bugs.webkit.org/show_bug.cgi?id=53636
1915
1916         Make sure that DrawingAreaImpl::display is never called when in accelerated compositing mode,
1917         since the layer tree host is supposed to handle all drawing in that case.
1918
1919         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1920         (WebKit::DrawingAreaImpl::scroll):
1921         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
1922         (WebKit::DrawingAreaImpl::setSize):
1923         (WebKit::DrawingAreaImpl::didUpdate):
1924
1925 2011-02-02  Mark Rowe  <mrowe@apple.com>
1926
1927         Fix the 32-bit build.
1928
1929         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1930         (WebKit::computeFakeWindowBoundsRect):
1931
1932 2011-02-02  Anders Carlsson  <andersca@apple.com>
1933
1934         Reviewed by Sam Weinig.
1935
1936         Make sure that we don't try to call display() when in accelerated compositing mode
1937         https://bugs.webkit.org/show_bug.cgi?id=53629
1938
1939         When in accelerated compositing mode, the layer tree host should handle all painting, so make sure that display() is never called.
1940
1941         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1942         (WebKit::DrawingAreaImpl::setNeedsDisplay):
1943         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
1944         (WebKit::DrawingAreaImpl::display):
1945
1946 2011-02-02  Adam Roben  <aroben@apple.com>
1947
1948         Assert WebBackForwardList's current index is valid to help catch errors
1949
1950         Hopefully this will help catch a crash I saw once but haven't yet been able to reproduce.
1951
1952         Fixes <http://webkit.org/b/53622>.
1953
1954         Reviewed by Brady Eidson.
1955
1956         * UIProcess/WebBackForwardList.cpp:
1957         (WebKit::WebBackForwardList::WebBackForwardList):
1958         (WebKit::WebBackForwardList::addItem):
1959         (WebKit::WebBackForwardList::goToItem):
1960         (WebKit::WebBackForwardList::currentItem):
1961         (WebKit::WebBackForwardList::backItem):
1962         (WebKit::WebBackForwardList::forwardItem):
1963         (WebKit::WebBackForwardList::itemAtIndex):
1964         (WebKit::WebBackForwardList::backListCount):
1965         (WebKit::WebBackForwardList::forwardListCount):
1966         (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
1967         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
1968         (WebKit::WebBackForwardList::clear):
1969         * UIProcess/cf/WebBackForwardListCF.cpp:
1970         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
1971         (WebKit::WebBackForwardList::restoreFromCFDictionaryRepresentation):
1972         Assert that m_current is valid.
1973
1974         * UIProcess/WebBackForwardList.h: Moved the NoCurrentItemIndex to a static data member so
1975         that it can be used from WebBackForwardListCF.cpp.
1976
1977 2011-02-02  Anders Carlsson  <andersca@apple.com>
1978
1979         Reviewed by Sam Weinig.
1980
1981         The drawing area proxy should keep track of the accelerated compositing state
1982         https://bugs.webkit.org/show_bug.cgi?id=53624
1983
1984         * UIProcess/DrawingAreaProxyImpl.cpp:
1985         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
1986         Initialize m_isInAcceleratedCompositingMode to false.
1987
1988         (WebKit::DrawingAreaProxyImpl::paint):
1989         Don't try to paint if we're in accelerated compositing mode.
1990
1991         (WebKit::DrawingAreaProxyImpl::didSetSize):
1992         Bail if we're in accelerated compositing mode.
1993
1994         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
1995         Set m_isInAcceleratedCompositingMode to true, null out the backing store.
1996
1997         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
1998         Set m_isInAcceleratedCompositingMode back to false.
1999
2000         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
2001         Assert that we're not in accelerated compositing mode.
2002
2003         * UIProcess/DrawingAreaProxyImpl.h:
2004
2005 2011-02-02  Timothy Hatcher  <timothy@apple.com>
2006
2007         Give the Web Process access to the Safari RSS preferences.
2008
2009         <rdar://problem/8916870> Sandbox violation related to RSS during initial
2010         page load with WebKit2 (prevents RSS from working)
2011
2012         Reviewed by Darin Adler.
2013
2014         * WebProcess/com.apple.WebProcess.sb:
2015
2016 2011-02-02  Steve Lacey  <sjl@chromium.org>
2017
2018         Reviewed by Eric Carlson.
2019
2020         Implement basic media statistics on media elements.
2021         https://bugs.webkit.org/show_bug.cgi?id=53322
2022
2023         * Configurations/FeatureDefines.xcconfig:
2024
2025 2011-02-01  Alexey Proskuryakov  <ap@apple.com>
2026
2027         Reviewed by Sam Weinig.
2028
2029         https://bugs.webkit.org/show_bug.cgi?id=53561
2030         <rdar://problem/8900228> Stepping through print previews in WebKit2 mode steps in and out of
2031         printing mode a lot
2032
2033         Disable NSView autodisplay, so that -[WKView drawRect:] isn't called (other than when
2034         resizing the window), so that we don't have to switch modes all the time.
2035
2036         * UIProcess/API/mac/PageClientImpl.h:
2037         * UIProcess/API/mac/PageClientImpl.mm:
2038         (WebKit::PageClientImpl::setAutodisplay):
2039         * UIProcess/PageClient.h:
2040         * UIProcess/WebPageProxy.cpp:
2041         (WebKit::WebPageProxy::setAutodisplay):
2042         * UIProcess/WebPageProxy.h:
2043         Pipe the call from WKPrintingView down to WKView.
2044
2045         * UIProcess/API/mac/WKPrintingView.mm:
2046         (-[WKPrintingView beginDocument]): Added. We don't want to autodisplay WKView while printing,
2047         because layout is changed to print at the time, and drawing to screen requires relayout.
2048         
2049         (-[WKPrintingView endDocument]): When not printing, turn autodisplay back on. Also, call
2050         -[super endDocument] for unknown but definitive good (oops!).
2051
2052 2011-02-02  David Hyatt  <hyatt@apple.com>
2053
2054         Reviewed by Darin Adler.
2055
2056         Conversion of right()/bottom() to maxX()/maxY() as part of the removal of those accessors.
2057
2058         * UIProcess/win/WebPopupMenuProxyWin.cpp:
2059         (WebKit::WebPopupMenuProxyWin::calculatePositionAndSize):
2060         * UIProcess/win/WebView.cpp:
2061         (WebKit::WebView::prepareCandidateWindow):
2062         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
2063         (WebKit::NetscapePlugin::platformGeometryDidChange):
2064
2065 2011-02-01  Darin Adler  <darin@apple.com>
2066
2067         Reviewed by Anders Carlsson.
2068
2069         Overflow in WebKit2 argument decoder buffer checking
2070         https://bugs.webkit.org/show_bug.cgi?id=53536
2071
2072         * Platform/CoreIPC/ArgumentDecoder.cpp:
2073         (CoreIPC::roundUpToAlignment): Tweak code a bit for clarity and to replace
2074         C casts with C++ casts.
2075         (CoreIPC::ArgumentDecoder::alignBufferPosition): Rearrange buffer calculation
2076         so we don't do any math with the passed-in size, because that could overflow.
2077         (CoreIPC::ArgumentDecoder::bufferIsLargeEnoughToContain): Ditto.
2078
2079 2011-02-01  Csaba Osztrogonác  <ossy@webkit.org>
2080
2081         Unreviewed.
2082
2083         Fix Qt build after r77339.
2084
2085         * UIProcess/API/qt/qwkpage.cpp:
2086         (QWKPagePrivate::enterAcceleratedCompositingMode):
2087         (QWKPagePrivate::exitAcceleratedCompositingMode):
2088         * UIProcess/API/qt/qwkpage_p.h:
2089
2090 2011-02-01  Anders Carlsson  <andersca@apple.com>
2091
2092         Reviewed by Dan Bernstein.
2093
2094         Attach the layer tree in the UI process
2095         https://bugs.webkit.org/show_bug.cgi?id=53560
2096
2097         * UIProcess/API/mac/WKView.mm:
2098         (-[WKView _enterAcceleratedCompositingMode:]):
2099         Make a render layer and add it as a sublayer of our root layer.
2100
2101         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
2102         Make LayerTreeHostMac a GraphicsLayerClient.
2103
2104         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
2105         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
2106         Create a root layer, add the layer subtree as a child of the root layer.
2107
2108         (WebKit::LayerTreeHostMac::~LayerTreeHostMac):
2109         Assert that m_rootLayer is null.
2110
2111         (WebKit::LayerTreeHostMac::invalidate):
2112         Null out m_rootLayer.
2113
2114         (WebKit::LayerTreeHostMac::notifyAnimationStarted):
2115         (WebKit::LayerTreeHostMac::notifySyncRequired):
2116         (WebKit::LayerTreeHostMac::paintContents):
2117         Add stubs.
2118
2119         (WebKit::LayerTreeHostMac::showDebugBorders):
2120         (WebKit::LayerTreeHostMac::showRepaintCounter):
2121         Return the correct settings.
2122
2123         (WebKit::LayerTreeHostMac::flushPendingLayerChanges):
2124         Flush the root layer changes.
2125
2126 2011-02-01  Anders Carlsson  <andersca@apple.com>
2127
2128         Fix Windows build.
2129
2130         * UIProcess/win/WebView.cpp:
2131         (WebKit::WebView::enterAcceleratedCompositingMode):
2132         (WebKit::WebView::exitAcceleratedCompositingMode):
2133         * UIProcess/win/WebView.h:
2134
2135 2011-02-01  Anders Carlsson  <andersca@apple.com>
2136
2137         Reviewed by Dan Bernstein.
2138
2139         Add a layer backed NSView for accelerated content
2140         https://bugs.webkit.org/show_bug.cgi?id=53555
2141
2142         Rename the current _layerHostingView to _oldLayerHostingView and
2143         add a new _layerHostingView to be used with the new drawing area.
2144
2145         * UIProcess/API/mac/WKView.mm:
2146         (-[WKView hitTest:]):
2147         (-[WKView _startAcceleratedCompositing:]):
2148         (-[WKView _stopAcceleratedCompositing]):
2149         (-[WKView _enterAcceleratedCompositingMode:]):
2150         (-[WKView _exitAcceleratedCompositingMode]):
2151
2152 2011-02-01  Anders Carlsson  <andersca@apple.com>
2153
2154         Reviewed by Dan Bernstein.
2155
2156         Pass enter/exit accelerated compositing mode to the WKView
2157         https://bugs.webkit.org/show_bug.cgi?id=53552
2158
2159         * UIProcess/API/mac/PageClientImpl.h:
2160         * UIProcess/API/mac/PageClientImpl.mm:
2161         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
2162         (WebKit::PageClientImpl::exitAcceleratedCompositingMode):
2163         * UIProcess/API/mac/WKView.mm:
2164         (-[WKView _enterAcceleratedCompositingMode:]):
2165         (-[WKView _exitAcceleratedCompositingMode]):
2166         * UIProcess/API/mac/WKViewInternal.h:
2167         * UIProcess/DrawingAreaProxyImpl.cpp:
2168         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
2169         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
2170         * UIProcess/PageClient.h:
2171         * UIProcess/WebPageProxy.cpp:
2172         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
2173         (WebKit::WebPageProxy::exitAcceleratedCompositingMode):
2174         * UIProcess/WebPageProxy.h:
2175
2176 2011-02-01  Csaba Osztrogonác  <ossy@webkit.org>
2177
2178         Unreviewed Qt buildfix after r77286.
2179
2180         https://bugs.webkit.org/show_bug.cgi?id=53520 
2181         Remove the physical terminology from IntRect and FloatRect.
2182
2183         * UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp:
2184         (WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore):
2185
2186 2011-02-01  Anders Carlsson  <andersca@apple.com>
2187
2188         Reviewed by Adam Roben.
2189
2190         Send messages when entering/exiting accelerated compositing
2191         https://bugs.webkit.org/show_bug.cgi?id=53534
2192
2193         * Shared/LayerTreeContext.h: Added.
2194         * Shared/mac/LayerTreeContextMac.mm: Added.
2195         Add new LayerTreeContext which holds all information needed to enter
2196         accelerated compositing mode.
2197
2198         * UIProcess/DrawingAreaProxy.h:
2199         (WebKit::DrawingAreaProxy::enterAcceleratedCompositingMode):
2200         (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
2201         Add empty stubs.
2202
2203         * UIProcess/DrawingAreaProxy.messages.in:
2204         Add new messgaes.
2205
2206         * UIProcess/DrawingAreaProxyImpl.cpp:
2207         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
2208         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
2209         * UIProcess/DrawingAreaProxyImpl.h:
2210         Add empty stubs.
2211
2212         * WebKit2.xcodeproj/project.pbxproj:
2213         Add new files.
2214
2215         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
2216         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
2217         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
2218         (WebKit::LayerTreeHostMac::invalidate):
2219         Send messages.
2220
2221 2011-02-01  Alexey Proskuryakov  <ap@apple.com>
2222
2223         Reviewed by Dan Bernstein and Darin Adler.
2224
2225         <rdar://problem/8830594> Printed page is sometimes shifted down, making footer invisible
2226
2227         * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView locationOfPrintRect:]): Instead of
2228         letting AppKit compute content position on page, make the view provide it. We can do this
2229         because WK(Printing)Views are always printed on their own, not as part of other views.
2230
2231 2011-02-01  Anders Carlsson  <andersca@apple.com>
2232
2233         Reviewed by Adam Roben.
2234
2235         Make LayerTreeHost ref counted
2236         https://bugs.webkit.org/show_bug.cgi?id=53530
2237
2238         LayerTreeHostMac will soon be able to trigger layout, which could cause
2239         the page to leave accelerated compositing mode and free the LayerTreeHostMac object.
2240
2241         Making LayerTreeHost ref counted will let LayerTreeHostMac protect itself while triggering layout.
2242
2243         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2244         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
2245         * WebProcess/WebPage/DrawingAreaImpl.h:
2246         * WebProcess/WebPage/LayerTreeHost.cpp:
2247         (WebKit::LayerTreeHost::create):
2248         * WebProcess/WebPage/LayerTreeHost.h:
2249         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
2250         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
2251         (WebKit::LayerTreeHostMac::create):
2252         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
2253         (WebKit::LayerTreeHostMac::~LayerTreeHostMac):
2254         (WebKit::LayerTreeHostMac::invalidate):
2255
2256 2011-02-01  Sam Weinig  <sam@webkit.org>
2257
2258         Reviewed by Beth Dakin.
2259
2260         Part 2 for <rdar://problem/8492788>
2261         Adopt WKScrollbarPainterController
2262
2263         Use header detection to define scrollbar painting controller #define.
2264
2265         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2266         (InitWebCoreSystemInterface):
2267
2268 2011-02-01  David Hyatt  <hyatt@apple.com>
2269
2270         Reviewed by Oliver Hunt.
2271
2272         https://bugs.webkit.org/show_bug.cgi?id=53520
2273         
2274         Remove the physical terminology from IntRect and FloatRect.
2275         
2276         Now that we have flipped RenderBlocks for vertical-rl and horizontal-bt writing modes,
2277         we need to update our terminology to be more accurate.
2278
2279         I'm borrowing a page from AppKit here (which also supports flipped NSViews) and
2280         renaming right() and bottom() to maxX() and maxY().  These terms remain accurate
2281         even for flipped rectangles.
2282
2283         * Platform/Region.cpp:
2284         (WebKit::Region::Shape::Shape):
2285         * UIProcess/API/mac/WKPrintingView.mm:
2286         (pageDidComputePageRects):
2287         * UIProcess/FindIndicator.cpp:
2288         (WebKit::FindIndicator::draw):
2289         * UIProcess/TiledDrawingAreaProxy.cpp:
2290         (WebKit::TiledDrawingAreaProxy::invalidate):
2291         (WebKit::TiledDrawingAreaProxy::paint):
2292         (WebKit::TiledDrawingAreaProxy::createTiles):
2293         * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
2294         (WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore):
2295         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2296         (WebKit::NetscapePlugin::callSetWindow):
2297
2298 2011-02-01  Anders Carlsson  <andersca@apple.com>
2299
2300         Reviewed by Adam Roben.
2301
2302         Move flushPendingLayerChanges to LayerTreeHostMac
2303         https://bugs.webkit.org/show_bug.cgi?id=53525
2304
2305         In preparation for adding more Mac specific code to flushPendingLayerChanges.
2306
2307         * WebProcess/WebPage/LayerTreeHost.cpp:
2308         * WebProcess/WebPage/LayerTreeHost.h:
2309         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
2310         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
2311         (WebKit::LayerTreeHostMac::flushPendingLayerChanges):
2312
2313 2011-02-01  Beth Dakin  <bdakin@apple.com>
2314
2315         Reviewed by Sam Weinig.
2316
2317         Fix for <rdar://problem/8492788> Adopt WKScrollbarPainterController
2318
2319         Implement NSView's viewWillStartLiveResize and
2320         viewDidEndLiveResize and propagate the messages down
2321         to WebCore.
2322         * UIProcess/API/mac/WKView.mm:
2323         (-[WKView viewWillStartLiveResize]):
2324         (-[WKView viewDidEndLiveResize]):
2325         * UIProcess/WebPageProxy.cpp:
2326         (WebKit::WebPageProxy::viewWillStartLiveResize):
2327         (WebKit::WebPageProxy::viewWillEndLiveResize):
2328         * UIProcess/WebPageProxy.h:
2329         * WebProcess/WebPage/WebPage.cpp:
2330         (WebKit::WebPage::viewWillStartLiveResize):
2331         (WebKit::WebPage::viewWillEndLiveResize):
2332         * WebProcess/WebPage/WebPage.h:
2333         * WebProcess/WebPage/WebPage.messages.in:
2334
2335         A bunch of new WebKitSystemInterface functions.
2336         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2337         (InitWebCoreSystemInterface):
2338
2339 2011-02-01  Dave Hyatt  <hyatt@apple.com>
2340
2341         Reviewed by Darin Adler.
2342
2343         https://bugs.webkit.org/show_bug.cgi?id=46422, make printing and pagination work
2344         with vertical text.
2345
2346         Change printing functions to check writing-mode and properly swap width and height
2347         as needed.
2348
2349         * WebProcess/WebPage/WebPage.cpp:
2350         (WebKit::WebPage::computePagesForPrinting):
2351
2352 2011-01-31  Alexey Proskuryakov  <ap@apple.com>
2353
2354         Reviewed by Maciej Stachowiak.
2355
2356         https://bugs.webkit.org/show_bug.cgi?id=53466
2357         Move WebKit2 to printing via API methods
2358
2359         Also fixes <rdar://problem/8933724> REGRESSION: Wrong pages are printed when not printing from page 1
2360
2361         Also fixes horizontal tiling (no bug filed).
2362
2363         The main idea here is that we don't force AppKit to use a different scaling factor when
2364         a Web view can't be resized to exact page size, and scale when drawing instead.
2365
2366         * UIProcess/API/mac/WKPrintingView.mm:
2367         (-[WKPrintingView _firstPrintedPageNumber]): Factored out into a separate method.
2368         (-[WKPrintingView _lastPrintedPageNumber]): Ditto.
2369         (pageDidDrawToPDF): Avoid crashing if data is null.
2370         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Use -_firstPrintedPageNumber
2371         and -_lastPrintedPageNumber.
2372         (pageDidComputePageRects): Set frame size to what it would have been for a normal NSView
2373         that's been asked to resize.
2374         (-[WKPrintingView _pageForRect:]): Check x(), because several pages can be at the same y()
2375         when tiling horizontally.
2376         (-[WKPrintingView _drawPDFDocument:page:atPoint:]): Point to draw at and frame size are
2377         now using different units, translate as appropriate.
2378         (-[WKPrintingView _drawPreview:]): Scale the rect to WebCore units.
2379         (-[WKPrintingView drawRect:]): Correctly calculate page number when the first page to print
2380         isn't page 1.
2381         (-[WKPrintingView rectForPage:]): Scale the rect to AppKit units.
2382
2383 2011-01-31  Darin Adler  <darin@apple.com>
2384
2385         Reviewed by Adele Peterson.
2386
2387         WKView should support scrollPageDown:, scrollPageUp:, scrollToBeg and other similar selectors
2388         https://bugs.webkit.org/show_bug.cgi?id=53460
2389
2390         * UIProcess/API/mac/WKView.mm: Added WEBCORE_COMMAND macro for lots of editor commands that
2391         are implemented in WebCore so they will get forwarded. Many of these will probably work without
2392         any further changes required. Added comments about the methods that we do not yet forward.
2393         (createSelectorExceptionMap): Map scrollPageDown: to ScrollPageForward and
2394         scrollPageUp: to ScrollPageBackward because we want the page up and page down
2395         keys to follow the document logical order, not physical order. This is equivalent
2396         to what we do in WebPage::performDefaultBehaviorForKeyEvent.
2397
2398 2011-01-31  Jessie Berlin  <jberlin@apple.com>
2399
2400         Reviewed by Steve Falkenburg.
2401
2402         WebKit2: the cookies used by the WebKit2 Web Process should not go in a top-level
2403         directory.
2404         https://bugs.webkit.org/show_bug.cgi?id=53278
2405
2406         Use the name WebKit2WebProcess since the default location for the cookies is determined
2407         based on the process name (which is WebKit2WebProcess.exe on Windows).
2408
2409         * win/WebKit2.make:
2410         Copy the WebKit2WebProcess.resources directory into the AppleInternal bin.
2411
2412         * win/WebKit2WebProcess.resources: Added.
2413         * win/WebKit2WebProcess.resources/Info.plist: Added.
2414         Copied from the WebKit version of Info.plist.
2415
2416         * win/WebKit2WebProcessPostBuild.cmd:
2417         Copy the WebKit2WebProcess.resources directory into the WebKitOutPutDir's bin.
2418
2419 2011-01-31  Anders Carlsson  <andersca@apple.com>
2420
2421         Reviewed by Adam Roben.
2422
2423         Make LayerTreeHost an abstract base class and make LayerTreeHostMac inherit from it
2424         https://bugs.webkit.org/show_bug.cgi?id=53432
2425
2426         * WebKit2.xcodeproj/project.pbxproj:
2427         Add LayerTreeHostMac.h.
2428
2429         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2430         * WebProcess/WebPage/DrawingAreaImpl.h:
2431         Make m_layerTreeHost an OwnPtr and initialize/destroy it appropriately.
2432
2433         * WebProcess/WebPage/LayerTreeHost.cpp:
2434         (WebKit::LayerTreeHost::create):
2435         On Mac, create a LayerTreeHostMac instance.
2436
2437         (WebKit::LayerTreeHost::~LayerTreeHost):
2438         No need to call platformInvalidate anymore.
2439
2440         * WebProcess/WebPage/LayerTreeHost.h:
2441         * WebProcess/WebPage/mac/LayerTreeHostMac.h: Added.
2442         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
2443         (WebKit::LayerTreeHostMac::~LayerTreeHostMac):
2444         Invalidate the run loop observer here instead of in platformInvalidate.
2445
2446         (WebKit::LayerTreeHostMac::scheduleLayerFlush):
2447         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
2448         These are now members of LayerTreeHostMac.
2449
2450 2011-01-30  Geoffrey Garen  <ggaren@apple.com>
2451
2452         Reviewed by Sam Weinig.
2453
2454         [Take 2!]
2455         Fixed crash on window close (maybe crash on launch?) due to missing frame null checks
2456         https://bugs.webkit.org/show_bug.cgi?id=53408
2457
2458         * UIProcess/WebContext.cpp:
2459         (WebKit::WebContext::didNavigateWithNavigationData):
2460         (WebKit::WebContext::didPerformClientRedirect):
2461         (WebKit::WebContext::didPerformServerRedirect):
2462         (WebKit::WebContext::didUpdateHistoryTitle): Use MESSAGE_CHECK because
2463         we don't think we should be able to reach this state under normal conditions.
2464
2465 2011-01-30  Geoffrey Garen  <ggaren@apple.com>
2466
2467         Reviewed by Maciej Stachowiak.
2468
2469         Fixed crash on window close (maybe crash on launch?) due to missing
2470         frame null checks
2471         https://bugs.webkit.org/show_bug.cgi?id=53408
2472
2473         * UIProcess/WebContext.cpp:
2474         (WebKit::WebContext::didNavigateWithNavigationData):
2475         (WebKit::WebContext::didPerformClientRedirect):
2476         (WebKit::WebContext::didPerformServerRedirect):
2477         (WebKit::WebContext::didUpdateHistoryTitle): Check for NULL, since we're
2478         calling a function that can return it.
2479
2480 2011-01-30  Balazs Kelemen  <kbalazs@webkit.org>
2481
2482         Reviewed by Csaba Osztrogonác.
2483
2484         [Qt][WK2]REGRESSION (r76991): Fix build errors
2485         https://bugs.webkit.org/show_bug.cgi?id=53400
2486
2487         Revert the temporary build fix (http://trac.webkit.org/changeset/77088)
2488         and remove WebKit2Prefix.h from the build.
2489         * UIProcess/API/qt/qwkhistory.h:
2490         * UIProcess/API/qt/qwkpage.h:
2491         * WebKit2.pro:
2492
2493 2011-01-30  Jeff Miller  <jeffm@apple.com>
2494
2495         Reviewed by Dan Bernstein.
2496
2497         FindController::updateFindIndicator() crashes if selection isn't visible
2498         https://bugs.webkit.org/show_bug.cgi?id=53399
2499
2500         * WebProcess/WebPage/FindController.cpp:
2501         (WebKit::FindController::updateFindIndicator): Return false if ShareableBitmap::createShareable() returns null (typically because the selection rect is empty).
2502
2503 2011-01-30  Csaba Osztrogonác  <ossy@webkit.org>
2504
2505         Unreviewed.
2506
2507         [Qt][WK2] Buildfix.
2508
2509         * UIProcess/API/qt/qwkhistory.h:
2510         * UIProcess/API/qt/qwkpage.h:
2511
2512 2011-01-29  Maciej Stachowiak  <mjs@apple.com>
2513
2514         Reviewed by Geoffrey Garen.
2515
2516         Add WKPageCopyPendingAPIRequestURL API
2517         https://bugs.webkit.org/show_bug.cgi?id=53383
2518
2519         This API returns the last URL requested for load via API, if neither that load nor any
2520         other load subsequently reaches the provisional state.
2521         
2522         This is useful to be able to track loads initiated via the API
2523         
2524         * UIProcess/API/C/WKPage.cpp:
2525         (WKPageCopyPendingAPIRequestURL): Retrieve the pending URL.
2526         * UIProcess/API/C/WKPage.h:
2527         * UIProcess/WebPageProxy.cpp:
2528         (WebKit::WebPageProxy::loadURL): Set pending URL.
2529         (WebKit::WebPageProxy::loadURLRequest): ditto
2530         (WebKit::WebPageProxy::reload): ditto
2531         (WebKit::WebPageProxy::goForward): ditto
2532         (WebKit::WebPageProxy::goBack): ditto
2533         (WebKit::WebPageProxy::estimatedProgress): Assume the initial
2534         progress value when there is a pending URL.
2535         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Clear
2536         pending URL; clients should look at the provisional URL now.
2537         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Clear
2538         pending URL if it doesn't match the policy URL; this means we
2539         were interrupted by another load.
2540         * UIProcess/WebPageProxy.h:
2541         (WebKit::WebPageProxy::pendingAPIRequestURL): Helper function.
2542         (WebKit::WebPageProxy::clearPendingAPIRequestURL): ditto
2543         (WebKit::WebPageProxy::setPendingAPIRequestURL): ditto
2544
2545 2011-01-28  Jon Honeycutt  <jhoneycutt@apple.com>
2546
2547         Downloads in WK2 on Windows should write resume data to bundle
2548         https://bugs.webkit.org/show_bug.cgi?id=53282
2549         <rdar://problem/8753077>
2550
2551         Reviewed by Alice Liu.
2552
2553         * WebProcess/Downloads/Download.cpp:
2554         (WebKit::Download::decideDestinationWithSuggestedFilename):
2555         Call didDecideDestination(), now that the destination is decided.
2556
2557         * WebProcess/Downloads/Download.h:
2558         Declare didDecideDestination(). Added member variables to hold the
2559         destination file path and the download bundle path.
2560         (WebKit::Download::destination):
2561         Return the path to the final destination for this download.
2562
2563         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
2564         (WebKit::Download::start):
2565         Remove the name of an unused param.
2566         (WebKit::Download::startWithHandle):
2567         Ditto.
2568         (WebKit::Download::cancel):
2569         Tell CFNetwork not to delete the file upon failure, and tell it to
2570         cancel the download. Copy the resume data for the download, and append
2571         it to the download bundle. Call didCancel() with an empty
2572         DataReference, since we have written our own resume data.
2573         (WebKit::decideDestinationWithSuggestedObjectNameCallback):
2574         Remove some unused param names. Removed the call to
2575         CFURLDownloadSetDestination() - this is now handled in
2576         Download::didDecideDestination().
2577         (WebKit::didCreateDestinationCallback):
2578         Report that the final destination was created, rather than the download
2579         bundle, matching old WebKit.
2580         (WebKit::Download::didDecideDestination):
2581         Store the final destination and the download bundle paths, and call
2582         CFURLDownloadSetDestination(), passing the path to the download bundle.
2583
2584         * WebProcess/Downloads/curl/DownloadCurl.cpp:
2585         (WebKit::Download::didDecideDestination):
2586         Stubbed.
2587
2588         * WebProcess/Downloads/mac/DownloadMac.mm:
2589         (WebKit::Download::didDecideDestination):
2590         Stubbed - unneeded on the Mac.
2591
2592         * WebProcess/Downloads/qt/DownloadQt.cpp:
2593         (WebKit::Download::didDecideDestination):
2594         Stubbed.
2595
2596 2011-01-29  Jeff Miller  <jeffm@apple.com>
2597
2598         Reviewed by Anders Carlsson.
2599
2600         Support find bouncy in WebKit2 on Windows
2601         https://bugs.webkit.org/show_bug.cgi?id=53329
2602         <rdar://problem/8565843>
2603         The Mac implements the find bouncy inside of WebKit in the UI process for WebKit2, but we need to do this inside Safari for WebKit2 on Windows.
2604         Add infrastructure to call back into the app when the find indicator changes.
2605
2606         * UIProcess/API/C/win/WKView.cpp: Cleanup some code style violations.
2607         (WKViewSetFindIndicatorCallback): Added.
2608         (WKViewGetFindIndicatorCallback): Added.
2609         * UIProcess/API/C/win/WKView.h: Cleanup some code style violations.
2610         * UIProcess/FindIndicator.cpp:
2611         (WebKit::FindIndicator::create):
2612         (WebKit::FindIndicator::FindIndicator):
2613         (WebKit::FindIndicator::frameRect):
2614         (WebKit::FindIndicator::draw):
2615         Rename m_selectionRect to m_selectionRectInWindowCoordinates and m_textRects to m_textRectsInSelectionRectCoordinates (along with similarly named local variables) to be more explict about the coordinate system.
2616         * UIProcess/FindIndicator.h:
2617         (WebKit::FindIndicator::selectionRectInWindowCoordinates): Added.
2618         (WebKit::FindIndicator::textRects): Rename m_textRects to m_textRectsInSelectionRectCoordinates.
2619         * UIProcess/WebPageProxy.cpp:
2620         (WebKit::WebPageProxy::setFindIndicator): Rename selectionRect to selectionRectInWindowCoordinates and textRects to textRectsInSelectionRectCoordinates to be more explict about the coordinate system.
2621         * UIProcess/WebPageProxy.h: Ditto.
2622         * UIProcess/win/WebView.cpp:
2623         (WebKit::WebView::WebView):
2624         (WebKit::WebView::setFindIndicator): Added.
2625         (WebKit::WebView::setFindIndicatorCallback): Added.
2626         (WebKit::WebView::getFindIndicatorCallback): Added.
2627         * UIProcess/win/WebView.h:
2628
2629 2011-01-28  Alexey Proskuryakov  <ap@apple.com>
2630
2631         Reviewed by Dan Bernstein.
2632
2633         https://bugs.webkit.org/show_bug.cgi?id=53367
2634         <rdar://problem/8926460> Remove dysfunctional code from -[WKPrintingView _isPrintingPreview].
2635
2636         * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView _isPrintingPreview]): The common
2637         branch works fine for now, no need to make platforms different.
2638
2639 2011-01-28  Maciej Stachowiak  <mjs@apple.com>
2640
2641         Reviewed by Dan Bernstein.
2642
2643         WKPageGetEstimatedProgress returns wrong value after a mainframe provisional load has started
2644         https://bugs.webkit.org/show_bug.cgi?id=53358
2645
2646         * UIProcess/WebPageProxy.cpp:
2647         (WebKit::WebPageProxy::didStartProgress): Start progress at the magic initial value, not 0.
2648
2649 2011-01-28  Anders Carlsson  <andersca@apple.com>
2650
2651         Yet another build fix (What was I thinking?)
2652
2653         * WebProcess/Downloads/Download.h:
2654         * WebProcess/Plugins/PluginProxy.h:
2655
2656 2011-01-28  Anders Carlsson  <andersca@apple.com>
2657
2658         Fix Windows build.
2659
2660         * Shared/PrintInfo.h:
2661
2662 2011-01-28  Anders Carlsson  <andersca@apple.com>
2663
2664         Fix tyop.
2665
2666         * Shared/mac/CoreAnimationRenderer.mm:
2667
2668 2011-01-28  Anders Carlsson  <andersca@apple.com>
2669
2670         Reviewed by Sam Weinig.
2671
2672         Add CoreAnimationRenderer class
2673         https://bugs.webkit.org/show_bug.cgi?id=53343
2674
2675         * Shared/mac/CoreAnimationRenderer.h: Added.
2676         * Shared/mac/CoreAnimationRenderer.mm: Added.
2677
2678         (WebKit::CoreAnimationRenderer::CoreAnimationRenderer):
2679         Initialize the underlying CARenderer object and hook up a notification observer.
2680
2681         (WebKit::CoreAnimationRenderer::~CoreAnimationRenderer):
2682         Assert that the client is null. It has been set to null by the call to invalidate().
2683
2684         (WebKit::CoreAnimationRenderer::setBounds):
2685         Update the bounds on the CARenderer and the root layer.
2686
2687         (WebKit::CoreAnimationRenderer::render):
2688         Ask the renderer to render and return the next frame time.
2689
2690         (WebKit::CoreAnimationRenderer::invalidate):
2691         Remove the change observer and reset the client.
2692
2693         (WebKit::CoreAnimationRenderer::rendererDidChange):
2694         Call the client member function.
2695
2696         * WebKit2.xcodeproj/project.pbxproj:
2697         Add new files.
2698
2699 2011-01-28  Anders Carlsson  <andersca@apple.com>
2700
2701         Reviewed by Sam Weinig.
2702
2703         Add an OBJC_CLASS macro for forward declaring an Objective-C class
2704         https://bugs.webkit.org/show_bug.cgi?id=53337
2705
2706         * Shared/NativeWebKeyboardEvent.h:
2707         * Shared/PrintInfo.h:
2708         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
2709         * UIProcess/LayerBackedDrawingAreaProxy.h:
2710         * UIProcess/WebInspectorProxy.h:
2711         * UIProcess/mac/WebContextMenuProxyMac.h:
2712         * UIProcess/mac/WebPopupMenuProxyMac.h:
2713         * WebProcess/Downloads/Download.h:
2714         * WebProcess/Plugins/PluginProxy.h:
2715         * WebProcess/WebPage/LayerBackedDrawingArea.h:
2716         * WebProcess/WebPage/WebPage.h:
2717         * config.h:
2718
2719 2011-01-28  Anders Carlsson  <andersca@apple.com>
2720
2721         Reviewed by Sam Weinig.
2722
2723         Don't put config.h in the message headers.
2724
2725         * Scripts/webkit2/messages.py:
2726         * Scripts/webkit2/messages_unittest.py:
2727
2728 2011-01-28  Anders Carlsson  <andersca@apple.com>
2729
2730         Fix build.
2731
2732         * Shared/mac/ShareableSurface.cpp:
2733
2734 2011-01-28  Anders Carlsson  <andersca@apple.com>
2735
2736         Try to unbreak the Windows build.
2737
2738         * UIProcess/cf/WebPageProxyCF.cpp:
2739
2740 2011-01-28  Brady Eidson  <beidson@apple.com>
2741
2742         Reviewed by John Sullivan.
2743
2744         https://bugs.webkit.org/show_bug.cgi?id=53330
2745         Need InjectedBundle API to get the response MIMEType for a URL
2746
2747         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2748         (WKBundleFrameCopyMIMETypeForResourceWithURL):
2749         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
2750
2751         Get the MIMEType from the in-memory cache, or cachedResponseMIMETypeForURL() if not available:
2752         * WebProcess/WebPage/WebFrame.cpp:
2753         (WebKit::WebFrame::mimeTypeForResourceWithURL):
2754         * WebProcess/WebPage/WebFrame.h:
2755
2756         Get the MIMEType from the platform's disk cache if available:
2757         * WebProcess/WebPage/WebPage.h:
2758         * WebProcess/WebPage/mac/WebPageMac.mm:
2759         (WebKit::WebPage::cachedResponseMIMETypeForURL):
2760         * WebProcess/WebPage/qt/WebPageQt.cpp:
2761         (WebKit::WebPage::cachedResponseMIMETypeForURL):
2762         * WebProcess/WebPage/win/WebPageWin.cpp:
2763         (WebKit::WebPage::cachedResponseMIMETypeForURL):
2764
2765 2011-01-28  Anders Carlsson  <andersca@apple.com>
2766
2767         Reviewed by Sam Weinig.
2768
2769         Clean up the mess introduced when config.h was added to the project:
2770
2771         - Remove the contents of WebKit2Prefix.h that is now in config.h, to avoid including everything
2772           twice in each file, probably slowing down compile time.
2773
2774         - Add config.h to all the files that were forgotten in order to keep the build from breaking.
2775
2776         - Added trap to ensure that config.h is included at the top of every implementation file. If this
2777           had been added it would have caught the previous issue.
2778
2779 2011-01-28  Stephanie Lewis  <slewis@apple.com>
2780
2781         Reviewed by Geoff Garen.
2782
2783         <rdar://problem/8857651> Implement unregisterWorld for WebKit2
2784         Rename unregisterWorld to clearWrappers.  Clearing the wrappers reduces the 
2785         memory use of isolated worlds.
2786
2787         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
2788         (WKBundleScriptWorldClearWrappers):
2789         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
2790         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
2791         (WebKit::InjectedBundleScriptWorld::clearWrappers):
2792         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
2793
2794 2011-01-28  Dan Bernstein  <mitz@apple.com>
2795
2796         Reviewed by Sam Weinig.
2797
2798         <select> can't display right-to-left (rtl) languages
2799         https://bugs.webkit.org/show_bug.cgi?id=19785
2800
2801         * Shared/WebPopupItem.cpp:
2802         (WebKit::WebPopupItem::WebPopupItem): Added initializers for m_textDirection and m_hasTextDirectionOverride.
2803         (WebKit::WebPopupItem::encode): Encode the item's writing direction and direction override values.
2804         (WebKit::WebPopupItem::decode): Decode the item's writing direction and direction override values.
2805         * Shared/WebPopupItem.h:
2806         * UIProcess/WebPageProxy.cpp:
2807         (WebKit::WebPageProxy::showPopupMenu): Added a parameter for the menu's text direction.
2808         * UIProcess/WebPageProxy.h:
2809         * UIProcess/WebPageProxy.messages.in: Ditto.
2810         * UIProcess/WebPopupMenuProxy.h:
2811         * UIProcess/mac/WebPopupMenuProxyMac.h:
2812         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2813         (WebKit::WebPopupMenuProxyMac::populate): Added a parameter for the menu's text direction.
2814         Set items' text alignment to match the menu's writing direction. Set items' writing direction
2815         and direction override according to their styles.
2816         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Set the pop-up's layout direction.
2817         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2818         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural): Changed to return false.
2819         (WebKit::WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection): Added.
2820         * WebProcess/WebCoreSupport/WebChromeClient.h:
2821         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
2822         (WebKit::WebPopupMenu::populateItems): Initialize items' writing direction and direction override
2823         values.
2824         (WebKit::WebPopupMenu::show): Pass the menu's writing direction.
2825
2826 2011-01-28  Anders Carlsson  <andersca@apple.com>
2827
2828         Reviewed by Adam Roben.
2829
2830         Add ShareableSurface class
2831         https://bugs.webkit.org/show_bug.cgi?id=53313
2832
2833         * Shared/mac/ShareableSurface.cpp: Added.
2834         (WebKit::ShareableSurface::Handle::Handle):
2835         Initialize the mach port.
2836
2837         (WebKit::ShareableSurface::Handle::~Handle):
2838         Deallocate our send right if needed.
2839
2840         (WebKit::ShareableSurface::Handle::encode):
2841         Encode the send right, and then null it out.
2842
2843         (WebKit::ShareableSurface::Handle::decode):
2844         Decode the send right.
2845         
2846         (WebKit::createIOSurface):
2847         Create an IOSurface with the given size.
2848
2849         (WebKit::ShareableSurface::create):
2850         Create an IOSurface, either from a size or from a handle.
2851
2852         (WebKit::ShareableSurface::~ShareableSurface):
2853         Delete the texture and framebuffer.
2854
2855         (WebKit::ShareableSurface::createHandle):
2856         Create a mach port from the surface.
2857
2858         (WebKit::ShareableSurface::attach):
2859         Create an FBO if needed and bind it.
2860
2861         (WebKit::ShareableSurface::detach):
2862         Unbind the FBO.
2863
2864         (WebKit::ShareableSurface::textureID):
2865         Generate a new texture and bind it to the IOSurface.
2866
2867         * Shared/mac/ShareableSurface.h: Added.
2868
2869         * WebKit2.xcodeproj/project.pbxproj:
2870         Add new files.
2871
2872 2011-01-27  Adam Roben  <aroben@apple.com>
2873
2874         Change BinarySemaphore to wrap an auto-reset Win32 event on Windows
2875
2876         Fixes <http://webkit.org/b/53208> <rdar://problem/8922490>.
2877
2878         Reviewed by Dave Hyatt.
2879
2880         * Platform/CoreIPC/BinarySemaphore.cpp: Wrap this implementation in #if !PLATFORM(WIN).
2881
2882         * Platform/CoreIPC/BinarySemaphore.h: Make the Windows implementation have a single HANDLE
2883         member that holds the event.
2884
2885         * Platform/CoreIPC/win/BinarySemaphoreWin.cpp: Copied from Source/WebKit2/Platform/CoreIPC/BinarySemaphore.cpp.
2886         (CoreIPC::BinarySemaphore::BinarySemaphore): Create our event.
2887         (CoreIPC::BinarySemaphore::~BinarySemaphore): Destory our event.
2888         (CoreIPC::BinarySemaphore::signal): Signal the event.
2889         (CoreIPC::BinarySemaphore::wait): Convert the absolute time to a wait interval, then wait
2890         for the event to be signaled or for the interval to elapse.
2891
2892         * win/WebKit2.vcproj: Added BinarySemaphoreWin.cpp. Also let VS have its way with the file.
2893
2894 2011-01-27  Chris Marrin  <cmarrin@apple.com>
2895
2896         Reviewed by Anders Carlsson.
2897
2898         WebKit2: Page flashes just before accelerated compositing animation
2899         https://bugs.webkit.org/show_bug.cgi?id=53274
2900
2901         When switching out of compositing mode, the new ChunkedUpdateDrawingAreaProxy
2902         is getting created with the current page size. When the setSize() call is
2903         subsequently made, the sizeDidChange() call is not made (which does the initial
2904         render of the page) because the old size and new size are the same. The solution
2905         is to skip the setting of the size in the ctor and let it go through a size
2906         change sequence.
2907
2908         * UIProcess/DrawingAreaProxy.cpp:
2909         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2910
2911 2011-01-28  Alejandro G. Castro  <alex@igalia.com>
2912
2913         Reviewed by Xan Lopez.
2914
2915         [GTK] Fix dist compilation for the release
2916         https://bugs.webkit.org/show_bug.cgi?id=53290
2917
2918         * GNUmakefile.am: Remove a file that is not in the repository
2919         anymore.
2920
2921
2922 2011-01-28  Andreas Kling  <kling@webkit.org>
2923
2924         Rubber-stamped by Simon Hausmann.
2925
2926         [Qt][WK2] Combine QWKPage::engine{Connected,Disconnected} into one signal.
2927
2928         Having two signals for this is redundant, combine them into
2929         QWKPage::engineConnectionChanged(bool connected).
2930
2931         * UIProcess/API/qt/qwkpage.cpp:
2932         (QWKPagePrivate::didRelaunchProcess):
2933         (QWKPagePrivate::processDidCrash):
2934         * UIProcess/API/qt/qwkpage.h:
2935
2936 2011-01-27  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2937
2938         Reviewed by Maciej Stachowiak.
2939
2940         Build fix for Mac Intel Debug after r76916
2941         https://bugs.webkit.org/show_bug.cgi?id=53284
2942
2943         Fix macro redefinition by guarding the redefined macros.
2944
2945         * config.h:
2946
2947 2011-01-27  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2948
2949         Unreviewed build fix for Mac Intel Debug after r76916.
2950
2951         Fix macro redefinition by guarding the redefined macros.
2952
2953         Check if the macro is already defined before defininig it.
2954         c++config.h has the same macros with the same values.
2955
2956         * config.h:
2957
2958 2011-01-27  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2959
2960         Reviewed by Adam Barth.
2961
2962         Update the expected results for test-webkitpy after r76916.
2963
2964         Include "config.h" in the expected results as well.
2965
2966         * Scripts/webkit2/messages_unittest.py:
2967
2968 2011-01-27  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
2969
2970         Unreviewed buildfix for SnowLeopard Intel Debug.
2971
2972         Fix macro redefinition by not including config.h.
2973
2974         Revert previous change in WebPageProxyCF.cpp.
2975
2976         * UIProcess/cf/WebPageProxyCF.cpp:
2977
2978 2011-01-27  Greg Coletta  <greg.coletta@nokia.com>
2979
2980         Reviewed by Laszlo Gombos.
2981
2982         Get rid of prefix header dependency for WebKit2 build system.
2983         https://bugs.webkit.org/show_bug.cgi?id=50174
2984
2985         Add config.h include explicitelly.
2986
2987         * Platform/CoreIPC/ArgumentDecoder.cpp:
2988         * Platform/CoreIPC/ArgumentEncoder.cpp:
2989         * Platform/CoreIPC/Attachment.cpp:
2990         * Platform/CoreIPC/BinarySemaphore.cpp:
2991         * Platform/CoreIPC/Connection.cpp:
2992         * Platform/CoreIPC/DataReference.cpp:
2993         * Platform/CoreIPC/gtk/ConnectionGtk.cpp:
2994         * Platform/CoreIPC/mac/ConnectionMac.cpp:
2995         * Platform/CoreIPC/qt/ConnectionQt.cpp:
2996         * Platform/CoreIPC/win/ConnectionWin.cpp:
2997         * Platform/Logging.cpp:
2998         * Platform/Module.cpp:
2999         * Platform/Region.cpp:
3000         * Platform/RunLoop.cpp:
3001         * Platform/WorkQueue.cpp:
3002         * Platform/cg/CGUtilities.cpp:
3003         * Platform/gtk/RunLoopGtk.cpp:
3004         * Platform/gtk/SharedMemoryGtk.cpp:
3005         * Platform/gtk/WorkQueueGtk.cpp:
3006         * Platform/mac/MachUtilities.cpp:
3007         * Platform/mac/SharedMemoryMac.cpp:
3008         * Platform/mac/WorkQueueMac.cpp:
3009         * Platform/qt/MappedMemoryPool.cpp:
3010         * Platform/qt/ModuleQt.cpp:
3011         * Platform/qt/RunLoopQt.cpp:
3012         * Platform/qt/WorkQueueQt.cpp:
3013         * Platform/win/ModuleWin.cpp:
3014         * Platform/win/RunLoopWin.cpp:
3015         * Platform/win/SharedMemoryWin.cpp:
3016         * Platform/win/WorkQueueWin.cpp:
3017         * PluginProcess/PluginControllerProxy.cpp:
3018         * PluginProcess/PluginProcess.cpp:
3019         * PluginProcess/WebProcessConnection.cpp:
3020         * Scripts/webkit2/messages.py:
3021         * Shared/API/c/WKArray.cpp:
3022         * Shared/API/c/WKCertificateInfo.cpp:
3023         * Shared/API/c/WKContextMenuItem.cpp:
3024         * Shared/API/c/WKData.cpp:
3025         * Shared/API/c/WKDictionary.cpp:
3026         * Shared/API/c/WKError.cpp:
3027         * Shared/API/c/WKImage.cpp:
3028         * Shared/API/c/WKMutableArray.cpp:
3029         * Shared/API/c/WKMutableDictionary.cpp:
3030         * Shared/API/c/WKNumber.cpp:
3031         * Shared/API/c/WKSecurityOrigin.cpp:
3032         * Shared/API/c/WKSerializedScriptValue.cpp:
3033         * Shared/API/c/WKString.cpp:
3034         * Shared/API/c/WKType.cpp:
3035         * Shared/API/c/WKURL.cpp:
3036         * Shared/API/c/WKURLRequest.cpp:
3037         * Shared/API/c/WKURLResponse.cpp:
3038         * Shared/API/c/WKUserContentURLPattern.cpp:
3039         * Shared/API/c/cf/WKStringCF.cpp:
3040         * Shared/API/c/cf/WKURLCF.cpp:
3041         * Shared/API/c/cf/WKURLRequestCF.cpp:
3042         * Shared/API/c/cf/WKURLResponseCF.cpp:
3043         * Shared/API/c/cg/WKImageCG.cpp:
3044         * Shared/API/c/win/WKCertificateInfoWin.cpp:
3045         * Shared/ChildProcess.cpp:
3046         * Shared/ImmutableArray.cpp:
3047         * Shared/ImmutableDictionary.cpp:
3048         * Shared/MutableArray.cpp:
3049         * Shared/MutableDictionary.cpp:
3050         * Shared/OriginAndDatabases.cpp:
3051         * Shared/PlatformPopupMenuData.cpp:
3052         * Shared/Plugins/NPIdentifierData.cpp:
3053         * Shared/Plugins/NPObjectMessageReceiver.cpp:
3054         * Shared/Plugins/NPObjectProxy.cpp:
3055         * Shared/Plugins/NPRemoteObjectMap.cpp:
3056         * Shared/Plugins/NPVariantData.cpp:
3057         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
3058         * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp:
3059         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
3060         * Shared/Plugins/PluginProcessCreationParameters.cpp:
3061         * Shared/PrintInfo.cpp:
3062         * Shared/SessionState.cpp:
3063         * Shared/ShareableBitmap.cpp:
3064         * Shared/UpdateInfo.cpp:
3065         * Shared/VisitedLinkTable.cpp:
3066         * Shared/WebBackForwardListItem.cpp:
3067         * Shared/WebContextMenuItem.cpp:
3068         * Shared/WebContextMenuItemData.cpp:
3069         * Shared/WebError.cpp:
3070         * Shared/WebEvent.cpp:
3071         * Shared/WebEventConversion.cpp:
3072         * Shared/WebGeolocationPosition.cpp:
3073         * Shared/WebImage.cpp:
3074         * Shared/WebKeyboardEvent.cpp:
3075         * Shared/WebMemorySampler.cpp:
3076         * Shared/WebMouseEvent.cpp:
3077         * Shared/WebOpenPanelParameters.cpp:
3078         * Shared/WebPageCreationParameters.cpp:
3079         * Shared/WebPageGroupData.cpp:
3080         * Shared/WebPlatformTouchPoint.cpp:
3081         * Shared/WebPopupItem.cpp:
3082         * Shared/WebPreferencesStore.cpp:
3083         * Shared/WebProcessCreationParameters.cpp:
3084         * Shared/WebTouchEvent.cpp:
3085         * Shared/WebURLRequest.cpp:
3086         * Shared/WebURLResponse.cpp:
3087         * Shared/WebWheelEvent.cpp:
3088         * Shared/cairo/ShareableBitmapCairo.cpp:
3089         * Shared/cf/ArgumentCodersCF.cpp:
3090         * Shared/cg/ShareableBitmapCG.cpp:
3091         * Shared/gtk/ShareableBitmapGtk.cpp:
3092         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
3093         * Shared/mac/CommandLineMac.cpp:
3094         * Shared/mac/UpdateChunk.cpp:
3095         * Shared/qt/CleanupHandler.cpp:
3096         * Shared/qt/NativeWebKeyboardEventQt.cpp:
3097         * Shared/qt/ShareableBitmapQt.cpp:
3098         * Shared/qt/UpdateChunk.cpp:
3099         * Shared/qt/WebCoreArgumentCodersQt.cpp:
3100         * Shared/qt/WebEventFactoryQt.cpp:
3101         * Shared/qt/WebURLRequestQt.cpp:
3102         * Shared/qt/WebURLResponseQt.cpp:
3103         * Shared/win/CommandLineWin.cpp:
3104         * Shared/win/NativeWebKeyboardEventWin.cpp:
3105         * Shared/win/PlatformCertificateInfo.cpp:
3106         * Shared/win/UpdateChunk.cpp:
3107         * Shared/win/WebCoreArgumentCodersWin.cpp:
3108         * Shared/win/WebEventFactory.cpp:
3109         * Shared/win/WebURLRequestWin.cpp:
3110         * Shared/win/WebURLResponseWin.cpp:
3111         * UIProcess/API/C/WKAuthenticationChallenge.cpp:
3112         * UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
3113         * UIProcess/API/C/WKBackForwardList.cpp:
3114         * UIProcess/API/C/WKBackForwardListItem.cpp:
3115         * UIProcess/API/C/WKContext.cpp:
3116         * UIProcess/API/C/WKCredential.cpp:
3117         * UIProcess/API/C/WKDatabaseManager.cpp:
3118         * UIProcess/API/C/WKDownload.cpp:
3119         * UIProcess/API/C/WKFormSubmissionListener.cpp:
3120         * UIProcess/API/C/WKFrame.cpp:
3121         * UIProcess/API/C/WKFramePolicyListener.cpp:
3122         * UIProcess/API/C/WKGeolocationManager.cpp:
3123         * UIProcess/API/C/WKGeolocationPermissionRequest.cpp:
3124         * UIProcess/API/C/WKGeolocationPosition.cpp:
3125         * UIProcess/API/C/WKInspector.cpp:
3126         * UIProcess/API/C/WKNavigationData.cpp:
3127         * UIProcess/API/C/WKOpenPanelParameters.cpp:
3128         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
3129         * UIProcess/API/C/WKPage.cpp:
3130         * UIProcess/API/C/WKPageGroup.cpp:
3131         * UIProcess/API/C/WKPreferences.cpp:
3132         * UIProcess/API/C/WKProtectionSpace.cpp:
3133         * UIProcess/API/C/win/WKContextWin.cpp:
3134         * UIProcess/API/C/win/WKView.cpp:
3135         * UIProcess/API/C/win/WKViewPrivate.cpp:
3136         * UIProcess/API/cpp/qt/WKStringQt.cpp:
3137         * UIProcess/API/cpp/qt/WKURLQt.cpp:
3138         * UIProcess/API/qt/ClientImpl.cpp:
3139         * UIProcess/API/qt/qgraphicswkview.cpp:
3140         * UIProcess/API/qt/qwkcontext.cpp:
3141         * UIProcess/API/qt/qwkpage.cpp:
3142         * UIProcess/API/qt/qwkpreferences.cpp:
3143         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
3144         * UIProcess/Authentication/AuthenticationDecisionListener.cpp:
3145         * UIProcess/Authentication/WebCredential.cpp:
3146         * UIProcess/Authentication/WebProtectionSpace.cpp:
3147         * UIProcess/BackingStore.cpp:
3148         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
3149         * UIProcess/Downloads/DownloadProxy.cpp:
3150         * UIProcess/DrawingAreaProxy.cpp:
3151         * UIProcess/DrawingAreaProxyImpl.cpp:
3152         * UIProcess/FindIndicator.cpp:
3153         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
3154         * UIProcess/GeolocationPermissionRequestProxy.cpp:
3155         * UIProcess/Launcher/ProcessLauncher.cpp:
3156         * UIProcess/Launcher/ThreadLauncher.cpp:
3157         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
3158         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp:
3159         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
3160         * UIProcess/Launcher/qt/ThreadLauncherQt.cpp:
3161         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
3162         * UIProcess/Launcher/win/ThreadLauncherWin.cpp:
3163         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
3164         * UIProcess/Plugins/PluginInfoStore.cpp:
3165         * UIProcess/Plugins/PluginProcessManager.cpp:
3166         * UIProcess/Plugins/PluginProcessProxy.cpp:
3167         * UIProcess/Plugins/gtk/PluginInfoStoreGtk.cpp:
3168         * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp:
3169         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
3170         * UIProcess/ResponsivenessTimer.cpp:
3171         * UIProcess/TiledDrawingAreaProxy.cpp:
3172         * UIProcess/VisitedLinkProvider.cpp:
3173         * UIProcess/WebBackForwardList.cpp:
3174         * UIProcess/WebContext.cpp:
3175         * UIProcess/WebContextInjectedBundleClient.cpp:
3176         * UIProcess/WebContextMenuProxy.cpp:
3177         * UIProcess/WebDatabaseManagerProxy.cpp:
3178         * UIProcess/WebDatabaseManagerProxyClient.cpp:
3179         * UIProcess/WebDownloadClient.cpp:
3180         * UIProcess/WebEditCommandProxy.cpp:
3181         * UIProcess/WebFindClient.cpp:
3182         * UIProcess/WebFormClient.cpp:
3183         * UIProcess/WebFormSubmissionListenerProxy.cpp:
3184         * UIProcess/WebFrameListenerProxy.cpp:
3185         * UIProcess/WebFramePolicyListenerProxy.cpp:
3186         * UIProcess/WebFrameProxy.cpp:
3187         * UIProcess/WebGeolocationManagerProxy.cpp:
3188         * UIProcess/WebGeolocationProvider.cpp:
3189         * UIProcess/WebHistoryClient.cpp:
3190         * UIProcess/WebInspectorProxy.cpp:
3191         * UIProcess/WebLoaderClient.cpp:
3192         * UIProcess/WebNavigationData.cpp:
3193         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
3194         * UIProcess/WebPageContextMenuClient.cpp:
3195         * UIProcess/WebPageGroup.cpp:
3196         * UIProcess/WebPageProxy.cpp:
3197         * UIProcess/WebPolicyClient.cpp:
3198         * UIProcess/WebPreferences.cpp:
3199         * UIProcess/WebProcessManager.cpp:
3200         * UIProcess/WebProcessProxy.cpp:
3201         * UIProcess/WebResourceLoadClient.cpp:
3202         * UIProcess/WebUIClient.cpp:
3203         * UIProcess/cf/WebBackForwardListCF.cpp:
3204         * UIProcess/cf/WebPageProxyCF.cpp:
3205         * UIProcess/cf/WebPreferencesCF.cpp:
3206         * UIProcess/gtk/TextCheckerGtk.cpp:
3207         * UIProcess/gtk/WebInspectorGtk.cpp:
3208         * UIProcess/gtk/WebPageProxyGtk.cpp:
3209         * UIProcess/gtk/WebPreferencesGtk.cpp:
3210         * UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp:
3211         * UIProcess/qt/TextCheckerQt.cpp:
3212         * UIProcess/qt/TiledDrawingAreaProxyQt.cpp:
3213         * UIProcess/qt/TiledDrawingAreaTileQt.cpp:
3214         * UIProcess/qt/WebContextMenuProxyQt.cpp:
3215         * UIProcess/qt/WebContextQt.cpp:
3216         * UIProcess/qt/WebInspectorProxyQt.cpp:
3217         * UIProcess/qt/WebPageProxyQt.cpp:
3218         * UIProcess/qt/WebPopupMenuProxyQt.cpp:
3219         * UIProcess/qt/WebPreferencesQt.cpp:
3220         * UIProcess/win/ChunkedUpdateDrawingAreaProxyWin.cpp:
3221         * UIProcess/win/LayerBackedDrawingAreaProxyWin.cpp:
3222         * UIProcess/win/TextCheckerWin.cpp:
3223         * UIProcess/win/WebContextMenuProxyWin.cpp:
3224         * UIProcess/win/WebContextWin.cpp:
3225         * UIProcess/win/WebInspectorProxyWin.cpp:
3226         * UIProcess/win/WebPageProxyWin.cpp:
3227         * UIProcess/win/WebPopupMenuProxyWin.cpp:
3228         * UIProcess/win/WebView.cpp:
3229         * WebKit2.xcodeproj/project.pbxproj:
3230         * WebProcess/Authentication/AuthenticationManager.cpp:
3231         * WebProcess/Downloads/Download.cpp:
3232         * WebProcess/Downloads/DownloadManager.cpp:
3233         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
3234         * WebProcess/Downloads/curl/DownloadCurl.cpp:
3235         * WebProcess/Downloads/qt/DownloadQt.cpp:
3236         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
3237         * WebProcess/Geolocation/WebGeolocationManager.cpp:
3238         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3239         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp:
3240         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
3241         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3242         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
3243         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
3244         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3245         * WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp:
3246         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3247         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
3248         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
3249         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3250         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3251         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3252         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
3253         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
3254         * WebProcess/InjectedBundle/InjectedBundleClient.cpp:
3255         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
3256         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
3257         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
3258         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
3259         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3260         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
3261         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
3262         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
3263         * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
3264         * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp:
3265         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
3266         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3267         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3268         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3269         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3270         * WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp:
3271         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3272         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3273         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
3274         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
3275         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
3276         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
3277         * WebProcess/Plugins/Plugin.cpp:
3278         * WebProcess/Plugins/PluginProcessConnection.cpp:
3279         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
3280         * WebProcess/Plugins/PluginProxy.cpp:
3281         * WebProcess/Plugins/PluginView.cpp:
3282         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3283         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
3284         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
3285         * WebProcess/WebCoreSupport/WebDragClient.cpp:
3286         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3287         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3288         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
3289         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3290         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
3291         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3292         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
3293         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
3294         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
3295         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
3296         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp:
3297         * WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp:
3298         * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp:
3299         * WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp:
3300         * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp:
3301         * WebProcess/WebCoreSupport/win/WebErrorsWin.cpp:
3302         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
3303         * WebProcess/WebKitMain.cpp:
3304         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
3305         * WebProcess/WebPage/DecoderAdapter.cpp:
3306         * WebProcess/WebPage/DrawingArea.cpp:
3307         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3308         * WebProcess/WebPage/EncoderAdapter.cpp:
3309         * WebProcess/WebPage/FindController.cpp:
3310         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
3311         * WebProcess/WebPage/PageOverlay.cpp:
3312         * WebProcess/WebPage/TiledDrawingArea.cpp:
3313         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3314         * WebProcess/WebPage/WebContextMenu.cpp:
3315         * WebProcess/WebPage/WebEditCommand.cpp:
3316         * WebProcess/WebPage/WebFrame.cpp:
3317         * WebProcess/WebPage/WebInspector.cpp:
3318         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
3319         * WebProcess/WebPage/WebPage.cpp:
3320         * WebProcess/WebPage/WebPageGroupProxy.cpp:
3321         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
3322         * WebProcess/WebPage/mac/ChunkedUpdateDrawingAreaMac.cpp:
3323         * WebProcess/WebPage/qt/ChunkedUpdateDrawingAreaQt.cpp:
3324         * WebProcess/WebPage/qt/TiledDrawingAreaQt.cpp:
3325         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
3326         * WebProcess/WebPage/qt/WebPageQt.cpp:
3327         * WebProcess/WebPage/win/ChunkedUpdateDrawingAreaWin.cpp:
3328         * WebProcess/WebPage/win/LayerBackedDrawingAreaWin.cpp:
3329         * WebProcess/WebPage/win/WebInspectorWin.cpp:
3330         * WebProcess/WebPage/win/WebPageWin.cpp:
3331         * WebProcess/WebProcess.cpp:
3332         * WebProcess/gtk/WebProcessGtk.cpp:
3333         * WebProcess/gtk/WebProcessMainGtk.cpp:
3334         * WebProcess/qt/WebProcessMainQt.cpp:
3335         * WebProcess/qt/WebProcessQt.cpp:
3336         * WebProcess/win/WebProcessMainWin.cpp:
3337         * WebProcess/win/WebProcessWin.cpp:
3338         * config.h: Copied from Source/WebKit2/WebKit2Prefix.h.
3339         * win/WebKit2Common.vsprops:
3340
3341 2011-01-27  Maciej Stachowiak  <mjs@apple.com>
3342
3343         Reviewed by Darin Adler.
3344
3345         execCommand("Paste") doesn't work in WebKitTestRunner
3346         https://bugs.webkit.org/show_bug.cgi?id=52785
3347         
3348         Thread through the new JavaScriptCanAccessClipboard setting.
3349
3350         * Shared/WebPreferencesStore.h:
3351         * UIProcess/API/C/WKPreferences.cpp:
3352         (WKPreferencesSetJavaScriptCanAccessClipboard):
3353         (WKPreferencesGetJavaScriptCanAccessClipboard):
3354         * UIProcess/API/C/WKPreferences.h:
3355         * WebProcess/WebPage/WebPage.cpp:
3356         (WebKit::WebPage::updatePreferences):
3357
3358 2011-01-27  Nate Chapin  <japhet@chromium.org>
3359
3360         Reviewed by Adam Barth.
3361
3362         Use Document::url() instead of FrameLoader::url().
3363         https://bugs.webkit.org/show_bug.cgi?id=41165
3364
3365         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3366         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
3367         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
3368         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
3369         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
3370         * WebProcess/WebPage/WebFrame.cpp:
3371         (WebKit::WebFrame::url):
3372
3373 2011-01-27  Sam Weinig  <sam@webkit.org>
3374
3375         Reviewed by Anders Carlsson.
3376
3377         Encode/Decode hasPreciseScrollingDeltas bit in WebWheelEvent
3378         https://bugs.webkit.org/show_bug.cgi?id=53254
3379
3380         * Shared/WebWheelEvent.cpp:
3381         (WebKit::WebWheelEvent::WebWheelEvent):
3382         Initialize m_phase and m_hasPreciseScrollingDeltas.
3383
3384         (WebKit::WebWheelEvent::encode):
3385         (WebKit::WebWheelEvent::decode):
3386         Add missing coding for m_hasPreciseScrollingDeltas.
3387
3388 2011-01-26  Enrica Casucci  <enrica@apple.com>
3389
3390         Reviewed by Darin Adler and Adam Roben.
3391
3392         WebKit2: add support for drag and drop on Windows
3393         https://bugs.webkit.org/show_bug.cgi?id=52775
3394         <rdar://problem/8514409>
3395
3396         On Windows the access to the content being dragged is
3397         provided via the IDataObject interface that is made available
3398         to the window that registers itself as drop target.
3399         Since this interface cannot be accessed from the WebProcess,
3400         in every call to one of the methods of the IDropTarget interface
3401         we serialize the content of the drag clipboard and send it over to
3402         the WebProcess. The implementation uses the same messages as the
3403         Mac one, with slightly different parameters to pass the serialized
3404         clipboard.
3405
3406         * UIProcess/WebPageProxy.cpp:
3407         (WebKit::WebPageProxy::performDragControllerAction): Added Windows
3408         specific implementation.
3409         * UIProcess/WebPageProxy.h:
3410         * UIProcess/win/WebView.cpp:
3411         (WebKit::WebView::WebView): Added dropTargetHelper object creation.
3412         (WebKit::WebView::initialize): Added to register for drag/drop with out
3413         refcount issues.
3414         (WebKit::WebView::close):
3415         (WebKit::WebView::windowReceivedMessage):
3416         (WebKit::WebView::QueryInterface):
3417         (WebKit::WebView::AddRef):
3418         (WebKit::WebView::Release):
3419         (WebKit::dragOperationToDragCursor):
3420         (WebKit::WebView::keyStateToDragOperation):
3421         (WebKit::WebView::DragEnter):
3422         (WebKit::WebView::DragOver):
3423         (WebKit::WebView::DragLeave):
3424         (WebKit::WebView::Drop):
3425         * UIProcess/win/WebView.h:
3426         (WebKit::WebView::create):
3427         * WebProcess/WebPage/WebPage.cpp:
3428         (WebKit::WebPage::performDragControllerAction):
3429         * WebProcess/WebPage/WebPage.h:
3430         * WebProcess/WebPage/WebPage.messages.in:
3431
3432 2011-01-26  Alexey Proskuryakov  <ap@apple.com>
3433
3434         Reviewed by Darin Adler.
3435
3436         https://bugs.webkit.org/show_bug.cgi?id=53197
3437         <rdar://problem/8895682> Make WebKit2 printing asynchronous
3438
3439         <rdar://problem/8899988> REGRESSION(WebKit2): Attempting to print WHATWG HTML spec shows
3440         1-page blank preview
3441
3442         <rdar://problem/8900078> WebKit2 printing has a separate message exchange per page when
3443         printing instead of printing all at once
3444
3445         * UIProcess/API/mac/WKPrintingView.h: Store a lot more cached information.
3446
3447         * UIProcess/API/mac/WKPrintingView.mm:
3448         (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]): Use PrintOperation stored in
3449         class. We generally want that now, because current operation will not be set up on other threads.
3450         (-[WKPrintingView _isPrintingPreview]): Added. Preview is different, because it can draw
3451         a placeholder - but actual printing need to wait until UI process has data.
3452         (-[WKPrintingView _updatePreview]): Force AppKit to update print preview when we have real
3453         data to replace placeholder with.
3454         (-[WKPrintingView _hasPageRects]): Return if page rects have already been computed.
3455         (-[WKPrintingView _expectedPreviewCallbackForRect:]): Find an existing request for this rect,
3456         if any.
3457         (pageDidDrawToPDF): Update preview - or if actually printing, release control to printing thread.
3458         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ask for a PDF document with
3459         pages the user asked to print.
3460         (pageDidComputePageRects): When web process returns page geometry data, we update preview to display
3461         a page count (which indirectly triggers a request for a preview). When actually printing,
3462         request a PDF right away, we'll need it later.
3463         (-[WKPrintingView _askPageToComputePageRects]): Ask web process for page geometry.
3464         (prepareDataForPrintingOnSecondaryThread): This function starts preparing all data necessary
3465         for actual printing on main thread.
3466         (-[WKPrintingView knowsPageRange:]): Changed to be async for preview, and to call main
3467         thread for actual printing.
3468         (-[WKPrintingView _pageForRect:]): Find page number for a given range, assuming that AppKit
3469         always asks for full pages.
3470         (-[WKPrintingView _drawPDFDocument:page:atPoint:]): A helper function to draw a PDF document.
3471         (-[WKPrintingView _drawPreview:]): Draw the whole page for preview.
3472         (-[WKPrintingView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
3473         Draw the whole page for actual printing.
3474         (-[WKPrintingView _drawPageBorderWithSizeOnMainThread:]): Call drawPageBorderWithSize: with
3475         correct graphics context and print operation.
3476         (-[WKPrintingView drawPageBorderWithSize:]): Delegate work to main thread when called from a
3477         secondary one.
3478         (-[WKPrintingView _provideTotalScaleFactorForPrintOperation:]): Added an assertion that
3479         our stored NSPrintOperation isn't out of sync with reality.
3480         (-[WKPrintingView rectForPage:]): Handle the case where we don't have the data yet, drawing
3481         a placeholder.
3482         (-[WKPrintingView endDocument]): When page setup changes, we must reset all state.
3483
3484         * UIProcess/API/mac/WKView.mm: (-[WKView printOperationWithPrintInfo:forFrame:]): Tell
3485         NSPrintingView which operation it's serving, so that it knows it even when current operation
3486         isn't set.
3487
3488         * UIProcess/GenericCallback.h:
3489         (WebKit::ComputedPagesCallback::create):
3490         (WebKit::ComputedPagesCallback::~ComputedPagesCallback):
3491         (WebKit::ComputedPagesCallback::performCallbackWithReturnValue):
3492         (WebKit::ComputedPagesCallback::invalidate):
3493         (WebKit::ComputedPagesCallback::callbackID):
3494         (WebKit::ComputedPagesCallback::generateCallbackID):
3495         (WebKit::ComputedPagesCallback::ComputedPagesCallback):
3496         Added ComputedPagesCallback, which returns a vector of IntRects and a double. Hopefully,
3497         it will become a specialization of GenericCallback one day.
3498
3499         * UIProcess/WebPageProxy.cpp:
3500         (WebKit::WebPageProxy::close): Added m_voidCallbacks - it looks like they were omitted
3501         by accident.
3502         (WebKit::WebPageProxy::computedPagesCallback): Added.
3503         (WebKit::WebPageProxy::processDidCrash): Added m_computedPagesCallbacks.
3504         (WebKit::WebPageProxy::computePagesForPrinting): Async now!
3505         (WebKit::WebPageProxy::drawRectToPDF): Ditto.
3506         (WebKit::WebPageProxy::drawPagesToPDF): Added.
3507         * UIProcess/WebPageProxy.h:
3508
3509         * UIProcess/WebPageProxy.messages.in: Added ComputedPagesCallback.
3510
3511         * WebProcess/WebPage/WebPage.cpp:
3512         (WebKit::WebPage::beginPriting): Compute page rects right away - we'll need them in
3513         drawPagesToPDF(), which doesn't have a PrintInfo.
3514         (WebKit::WebPage::computePagesForPrinting): Send async response.
3515         (WebKit::WebPage::drawRectToPDF): This function used to draw into original
3516         location at frame coordinates, and now it draws at (0, 0).
3517         (WebKit::WebPage::drawPagesToPDF): Added - make a multi-page PDF.
3518         * WebProcess/WebPage/WebPage.h: