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