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