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