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