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