7de8bca8cfcf0418a490b4600536463644e142a7
[WebKit.git] / Source / WebKit2 / ChangeLog
1 2011-02-04  Sam Weinig  <sam@webkit.org>
2
3         Reviewed by Mark Rowe.
4
5         Sandbox violations when visiting a site using HTTP authentication
6         <rdar://problem/8951079> 
7
8         * WebProcess/com.apple.WebProcess.sb:
9
10 2011-02-04  Alexey Proskuryakov  <ap@apple.com>
11
12         Reviewed by Darin Adler.
13
14         https://bugs.webkit.org/show_bug.cgi?id=53823
15         Print layout sometimes seen on screen
16
17         <rdar://problem/8948742> REGRESSION (WebKit2) - When I print a page, I visually see it re-layout
18         <rdar://problem/8899389> REGRESSION(WebKit2): Wrong content can appear when print dialog is up
19
20         * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setAutodisplay): Removed a
21         branch that didn't do anything useful.
22
23         * UIProcess/API/mac/WKPrintingView.h:
24         * UIProcess/API/mac/WKPrintingView.mm:
25         (-[WKPrintingView _suspendAutodisplay]):
26         (-[WKPrintingView _delayedResumeAutodisplayTimerFired]):
27         (-[WKPrintingView _delayedResumeAutodisplay]):
28         (-[WKPrintingView knowsPageRange:]):
29         (-[WKPrintingView beginDocument]):
30         (-[WKPrintingView endDocument]):
31         When page setup changes, or when going from print preview to actual printing, AppKit calls
32         -endDocument just to begin it again. Delay resuming autodisplay until the next run loop
33         iteration.
34
35         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
36         (WebKit::WebChromeClient::invalidateContentsAndWindow):
37         (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
38         Tightened it up from other side - we should never send pixels to UI process while in
39         printing mode. This is not 100% reliable, because relayout doesn't happen immediately,
40         and we can still have print layout in screen mode - but it helps.
41
42 2011-02-04  Sam Weinig  <sam@webkit.org>
43
44         Reviewed by Mark Rowe.
45
46         Fix for <rdar://problem/8961580>.
47         Work around for <rdar://problem/8957845>.
48
49         * WebProcess/com.apple.WebProcess.sb:
50
51 2011-02-04  Darin Adler  <darin@apple.com>
52
53         Reviewed by Dan Bernstein.
54
55         WebKit2 doesn't hide mouse pointer on keypress
56         https://bugs.webkit.org/show_bug.cgi?id=53821
57         rdar://problem/8630895
58
59         * UIProcess/PageClient.h: Renamed didNotHandleKeyEvent to
60         doneWithKeyEvent and added a bool wasEventHandled argument.
61         * UIProcess/WebPageProxy.cpp:
62         (WebKit::WebPageProxy::didReceiveEvent): Changed code to call
63         doneWithKeyEvent and call even if event was handled.
64
65         * UIProcess/API/mac/PageClientImpl.h: Updated for above change.
66         * UIProcess/API/mac/PageClientImpl.mm:
67         (WebKit::PageClientImpl::doneWithKeyEvent): Ditto. But also
68         call [NSCursor setHiddenUntilMouseMoves:YES] when a key down
69         event was handled. This matches what -[WebHTMLView keyDown:] does.
70         * UIProcess/API/qt/qwkpage.cpp:
71         (QWKPagePrivate::doneWithKeyEvent): Ditto.
72         * UIProcess/API/qt/qwkpage_p.h: Ditto.
73         * UIProcess/win/WebView.cpp:
74         (WebKit::WebView::doneWithKeyEvent): Ditto.
75         * UIProcess/win/WebView.h: Ditto.
76
77 2011-02-04  Steve Falkenburg  <sfalken@apple.com>
78
79         Reviewed by Adam Roben.
80
81         WebKit2 clients fail to launch on Windows if client exe is in a different directory from WebKit
82         https://bugs.webkit.org/show_bug.cgi?id=53810
83         <rdar://problem/8946085>
84         
85         If WebKit2WebProcess.exe is in a different directory from the client process, and that
86         client process uses CreateProcess to launch WebKit2WebProcess, the DLL search path may
87         end up excluding the directory containing WebKit. To address this, we use SetDllDirectory
88         to explicitly include the WebKit directory in the DLL search path.
89
90         * win/MainWin.cpp:
91         (wWinMain): Use SetDllDirectory and LoadLibrary to load WebKit.dll from WebKit2WebProcess.exe
92         * win/WebKit2WebProcessCommon.vsprops: Don't link directly to WebKit. Link against shlwapi.
93
94 2011-02-04  Adam Roben  <aroben@apple.com>
95
96         Allow passing a null filter callback to WKPageCopySessionState
97
98         WebKit2 part of <http://webkit.org/b/53616> <rdar://problem/8949883>.
99
100         Reviewed by Sam Weinig.
101
102         * UIProcess/cf/WebBackForwardListCF.cpp:
103         (WebKit::WebBackForwardList::createCFDictionaryRepresentation): Check if the filter is null
104         before calling it.
105
106 2011-02-04  Brian Weinstein  <bweinstein@apple.com>
107
108         Reviewed by John Sullivan.
109
110         WebKit2: DidInitiateLoadForResource needs to know if the resource is being loaded by a committed or provisional frame
111         https://bugs.webkit.org/show_bug.cgi?id=53794
112         
113         When we navigate from one page to another, there can be multiple subresource requests between when
114         the new page has started its provisional load and when it has committed the load.
115         
116         There can be:
117         
118         - The main resource load of the provisional page
119         - Synchronous XHR from the unload event of the loaded page.
120         
121         WebKit clients need to be able to differentiate between these loads.
122
123         * UIProcess/API/C/WKPage.h:
124         * UIProcess/WebPageProxy.cpp:
125         (WebKit::WebPageProxy::didInitiateLoadForResource): Pass whether or not the page is provisionally loading
126             to the client.
127         * UIProcess/WebPageProxy.h:
128         * UIProcess/WebPageProxy.messages.in: Add a new parameter to DidInitiateLoadForResource.
129         * UIProcess/WebResourceLoadClient.cpp:
130         (WebKit::WebResourceLoadClient::didInitiateLoadForResource):  a new parameter to didInitiateLoadForResource.
131         * UIProcess/WebResourceLoadClient.h:
132         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
133         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Pass whether or not the page is currently
134             in a provisional load (checked by seeing if the DocumentLoader matches the FrameLoader's provisionalDocumentLoader)
135             to the UI Process.
136
137 2011-02-04  Anders Carlsson  <andersca@apple.com>
138
139         Reviewed by Mark Rowe.
140
141         Mac WebKit2 should use the new drawing area
142         https://bugs.webkit.org/show_bug.cgi?id=53802
143         <rdar://problem/7881419>
144         <rdar://problem/7881447>
145         <rdar://problem/8252632>
146         <rdar://problem/8479422>
147         <rdar://problem/8633813>
148         <rdar://problem/8734512>
149         <rdar://problem/8787660>
150
151         * UIProcess/API/mac/WKView.mm:
152         (useNewDrawingArea):
153         Return true. Eventually this function should be removed, but let's keep it for now so
154         we can go back to the old drawing area if necessary.
155
156 2011-02-04  Maciej Stachowiak  <mjs@apple.com>
157
158         Reviewed by Anders Carlsson.
159
160         WebKit2: Crash in WebPageProxy::setPendingAPIRequestURL after web process crashed
161         https://bugs.webkit.org/show_bug.cgi?id=53799
162         <rdar://problem/8943956>
163
164         * UIProcess/WebPageProxy.cpp:
165         (WebKit::WebPageProxy::reload):
166
167 2011-02-04  Anders Carlsson  <andersca@apple.com>
168
169         Reviewed by Maciej Stachowiak.
170
171         Fix a shared memory leak
172         https://bugs.webkit.org/show_bug.cgi?id=53800
173
174         Move the send right representing the shared memory.
175
176         * Platform/mac/SharedMemoryMac.cpp:
177         (WebKit::SharedMemory::Handle::encode):
178
179 2011-02-04  Brady Eidson  <beidson@apple.com>
180
181         Reviewed by Anders Carlsson.
182
183         <rdar://problem/8636239> and https://bugs.webkit.org/show_bug.cgi?id=53785
184         WebKit2: Pages with dynamically inserted iframes can add extraneous back/forward items.
185
186         WebCore doesn't gracefully handle the case where the decidePolicyForNavigationAction callback
187         does not occur synchronously. Let's make it synchronous.
188
189         Change WebPageProxy to handle this message reply synchronously:
190         * UIProcess/WebPageProxy.cpp:
191         (WebKit::WebPageProxy::WebPageProxy):
192         (WebKit::WebPageProxy::receivedPolicyDecision):
193         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
194         * UIProcess/WebPageProxy.h:
195         * UIProcess/WebPageProxy.messages.in: Make the navigation policy action message be synchronous.
196
197         * Platform/CoreIPC/HandleMessage.h:
198         (CoreIPC::callMemberFunction): Add a 6-argument varient 
199
200         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
201         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Send the message synchronously.
202
203 2011-02-04  Steve Falkenburg  <sfalken@apple.com>
204
205         Windows build fix.
206         Correct prebuild build-stopping rule to allow project only rebuilds.
207
208         * win/WebKit2WebProcessPreBuild.cmd:
209
210 2011-02-04  Brian Weinstein  <bweinstein@apple.com>
211
212         Reviewed by Adam Roben.
213
214         Assertion failure in WebInspectorProxy::platformClose closing main window when inspecting a popup 
215         window, or when running regression tests.
216         https://bugs.webkit.org/show_bug.cgi?id=53798
217         <rdar://problem/8814364>
218         
219         Only assert about the state of m_inspectorWindow and m_inspectorView if the inspector is visible.
220         Also, only call ::DestroyWindow if the HWND is non-null, just to be safe.
221
222         * UIProcess/win/WebInspectorProxyWin.cpp:
223         (WebKit::WebInspectorProxy::platformClose):
224
225 2011-02-04  Anders Carlsson  <andersca@apple.com>
226
227         Reviewed by Dan Bernstein.
228
229         Go out of accelerated compositing mode when the drawing area is destroyed
230         https://bugs.webkit.org/show_bug.cgi?id=53788
231
232         This fixes a crash in the UI process if a web process crashes while in accelerated compositing mode.
233
234         * UIProcess/DrawingAreaProxyImpl.cpp:
235         (WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl):
236
237 2011-02-03  Yury Semikhatsky  <yurys@chromium.org>
238
239         Reviewed by Pavel Feldman.
240
241         Web Inspector: remove settings related methods from InspectorClient
242         https://bugs.webkit.org/show_bug.cgi?id=53686
243
244         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
245         (WebKit::WebInspectorFrontendClient::WebInspectorFrontendClient):
246
247 2011-02-03  Maciej Stachowiak  <mjs@apple.com>
248
249         Reviewed by Dan Bernstein.
250
251         WebKit2: Need WebKit2 equivalent of WebResourceLoadDelegate::willSendRequest in the Bundle
252         https://bugs.webkit.org/show_bug.cgi?id=52897
253         <rdar://problem/8898294>
254
255         * Shared/API/c/WKSharedAPICast.h:
256         (WebKit::toAPI):
257         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
258         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
259         (WebKit::InjectedBundlePageLoaderClient::willSendRequestForFrame):
260         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
261         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
262         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
263
264 2011-02-03  Ivan Krstić  <ike@apple.com>
265
266         Reviewed by Maciej Stachowiak.
267
268         Make WebProcess pass explicit homedir parameter to the sandbox
269         <rdar://problem/8405760>
270         <https://webkit.org/b/53558>
271
272         * WebProcess/com.apple.WebProcess.sb:
273         * WebProcess/mac/WebProcessMac.mm:
274         (WebKit::initializeSandbox):
275
276 2011-02-03  James Kozianski  <koz@chromium.org>
277
278         Reviewed by Dimitri Glazkov.
279
280         Add navigator.registerProtocolHandler behind a flag.
281         https://bugs.webkit.org/show_bug.cgi?id=52609
282
283         * Configurations/FeatureDefines.xcconfig:
284
285 2011-02-03  Adam Langley  <agl@chromium.org>
286
287         Reviewed by Adam Barth.
288
289         Plumb mixed script URL to FrameLoaderClient
290         https://bugs.webkit.org/show_bug.cgi?id=52384
291
292         Regressions covered by http/tests/security/mixedContent/*
293
294         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
295         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
296         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
297
298 2011-02-03  Jon Honeycutt  <jhoneycutt@apple.com>
299
300         Download bundles should be moved to their final destination when they
301         finish.
302
303         https://bugs.webkit.org/show_bug.cgi?id=53668
304
305         Reviewed by Adam Roben.
306
307         * WebProcess/Downloads/Download.cpp:
308         (WebKit::Download::Download):
309         Initialize m_allowOverwrite.
310         (WebKit::Download::retrieveDestinationWithSuggestedFilename):
311         Return the result of requesting the destination filename from the UI
312         process.
313         (WebKit::Download::decideDestinationWithSuggestedFilename):
314         Call retrieveDestinationWithSuggestedFilename().
315         (WebKit::Download::didFinish):
316         Call platformDidFinish().
317
318         * WebProcess/Downloads/Download.h:
319         Declare retrieveDestinationWithSuggestedFilename() and
320         platformDidFinish(). Add a member variable to store whether the UI
321         process would like us to overwrite existing files.
322
323         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
324         (WebKit::willResumeWithResponseCallback):
325         Remove some trailing whitespace.
326
327         * WebProcess/Downloads/curl/DownloadCurl.cpp:
328         (WebKit::Download::platformDidFinish):
329         Stubbed.
330
331         * WebProcess/Downloads/mac/DownloadMac.mm:
332         (WebKit::Download::platformDidFinish):
333         Stubbed.
334
335         * WebProcess/Downloads/qt/DownloadQt.cpp:
336         (WebKit::Download::platformDidFinish):
337         Stubbed.
338
339         * WebProcess/Downloads/cf/win/DownloadCFNetWin.cpp:
340         (WebKit::Download::didDecideDestination):
341         Store whether the UI process would like us to overwrite existing files.
342         (WebKit::Download::platformDidFinish):
343         Try to move the bundle to the final destination. If that fails, ask the
344         UI process for a new destination. If we receive one, try again to move
345         the bundle. Call didCreateDestination() to report the updated path of
346         file whether it's the bundle that we failed to move, or the new final
347         destination.
348
349         This is similar to what is done by WebKit 1's CFNetwork port.
350
351         * win/WebKit2.vcproj:
352         Add DownloadWin.cpp.
353
354 2011-02-01  Jon Honeycutt  <jhoneycutt@apple.com>
355
356         Small clean-up in DownloadCFNet.cpp.
357
358         Rubber-stamped by Mark Rowe.
359
360         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
361         (WebKit::Download::didDecideDestination):
362         Moved out of the section labeled "CFURLDownload callbacks" and up near
363         the other member functions.
364
365 2011-02-03  Anders Carlsson  <andersca@apple.com>
366
367         Reviewed by Sam Weinig.
368
369         Paint non-composited contents in a layer
370         https://bugs.webkit.org/show_bug.cgi?id=53742
371
372         * WebProcess/WebPage/DrawingAreaImpl.cpp:
373         (WebKit::DrawingAreaImpl::setNeedsDisplay):
374         Call LayerTreeHost::setNonCompositedContentsNeedDisplayInRect.
375
376         (WebKit::DrawingAreaImpl::scroll):
377         Call LayerTreeHost::scrollNonCompositedContents.
378
379         (WebKit::DrawingAreaImpl::setSize):
380         Call LayerTreeHost::sizeDidChange.
381
382         * WebProcess/WebPage/LayerTreeHost.h:
383         Add new pure virtual member functions.
384
385         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
386         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
387         Create the non-composited content layer.
388
389         (WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplayInRect):
390         Call setNeedsDisplay on the GraphicsLayer.
391
392         (WebKit::LayerTreeHostMac::scrollNonCompositedContents):
393         Just call setNonCompositedContentsNeedDisplayInRect.
394
395         (WebKit::LayerTreeHostMac::sizeDidChange):
396         Resize the layers and flush any changes.
397         
398         (WebKit::LayerTreeHostMac::paintContents):
399         Call WebPage::drawRect.
400
401         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
402         Lay out the web page.
403
404         (WebKit::LayerTreeHostMac::flushPendingLayerChanges):
405         Call syncCompositingStateForThisLayerOnly on the non-composited content layer.
406
407 2011-02-03  Anders Carlsson  <andersca@apple.com>
408
409         Reviewed by Sam Weinig.
410
411         When in accelerated compositing mode, wait for DidSetSize messages
412         https://bugs.webkit.org/show_bug.cgi?id=53736
413
414         Normally we wait for DidSetSize messages from ::paint, but that's never called in 
415         accelerated compositing mode so we just do it right after sending the SetSize message.
416
417         * UIProcess/DrawingAreaProxyImpl.cpp:
418         (WebKit::DrawingAreaProxyImpl::paint):
419         Call waitForAndDispatchDidSetSize.
420
421         (WebKit::DrawingAreaProxyImpl::sendSetSize):
422         Call waitForAndDispatchDidSetSize when in accelerated compositing mode.
423
424         (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidSetSize):
425         New utility function which waits for and dispatches a DidSetSize message.
426
427         * UIProcess/DrawingAreaProxyImpl.h:
428
429 2011-02-03  Anders Carlsson  <andersca@apple.com>
430
431         Reviewed by Dan Bernstein.
432
433         Pass along an UpdateInfo object to the ExitAcceleratedCompositingMode message
434         https://bugs.webkit.org/show_bug.cgi?id=53734
435
436         * UIProcess/DrawingAreaProxy.h:
437         (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
438         Add an UpdateInfo parameter.
439
440         * UIProcess/DrawingAreaProxy.messages.in:
441         Add an UpdateInfo parameter to the ExitAcceleratedCompositingMode message.
442
443         * UIProcess/DrawingAreaProxyImpl.cpp:
444         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
445         Incorporate the passed in update.
446
447         * WebProcess/WebPage/DrawingAreaImpl.cpp:
448         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
449         Create a new UpdateInfo object, paint into it and pass it along as a parameter
450         to the ExitAcceleratedCompositingMode message.
451
452 2011-02-03  Beth Dakin  <bdakin@apple.com>
453
454         Reviewed by Sam Weinig.
455
456         Fix for <rdar://problem/8944544> Ability to animate track
457         for WKPainter scrollers
458
459         * WebCoreSupport/WebSystemInterface.mm:
460         (InitWebCoreSystemInterface):
461
462 2011-02-03  Anders Carlsson  <andersca@apple.com>
463
464         Reviewed by Dan Bernstein.
465
466         Change DidSetSize to take a LayerTreeContext parameter
467         https://bugs.webkit.org/show_bug.cgi?id=53724
468
469         Since SetSize can cause layout to happen, we need to pass along a layer tree context to 
470         the DidSetSize message so the UI process can enter/exit accelerated compositing mode appropriately.
471         
472         * Shared/LayerTreeContext.h:
473         * Shared/mac/LayerTreeContextMac.mm:
474         Add equality operators to LayerTreeContext.
475
476         * UIProcess/DrawingAreaProxy.h:
477         (WebKit::DrawingAreaProxy::didSetSize):
478         This now takes a LayerTreeContext parameter.
479         
480         * UIProcess/DrawingAreaProxy.messages.in:
481         Add LayerTreeContext parameter.
482
483         * UIProcess/DrawingAreaProxyImpl.cpp:
484         Get rid of m_isInAcceleratedCompositingMode and use the current layer context instead.
485
486         (WebKit::DrawingAreaProxyImpl::paint):
487         Bail if the call to DidSetSize ended up entering accelerated compositing mode.
488
489         (WebKit::DrawingAreaProxyImpl::didSetSize):
490         If the new layer tree context is different, enter/exit accelerated compositing mode accordingly.
491
492         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
493         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
494         Update the layer tree context.
495
496         * UIProcess/DrawingAreaProxyImpl.h:
497         (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode):
498         Add simple getter.
499
500         * WebProcess/WebPage/DrawingAreaImpl.cpp:
501         (WebKit::DrawingAreaImpl::setSize):
502         Pass along the layer tree context.
503
504 2011-02-03  Anders Carlsson  <andersca@apple.com>
505
506         Reviewed by Dan Bernstein.
507
508         Get rid of LayerTreeContext::seed on Mac.
509         Add sequence checks to enterAcceleratedCompositingMode and exitAcceleratedCompositingMode and
510         have them call newly added overloads that don't have the checks.
511
512         * Shared/LayerTreeContext.h:
513         * Shared/mac/LayerTreeContextMac.mm:
514         (WebKit::LayerTreeContext::LayerTreeContext):
515         (WebKit::LayerTreeContext::encode):
516         (WebKit::LayerTreeContext::decode):
517         * UIProcess/DrawingAreaProxyImpl.cpp:
518         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
519         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
520         * UIProcess/DrawingAreaProxyImpl.h:
521         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
522         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
523
524 2011-02-03  Anders Carlsson  <andersca@apple.com>
525
526         Reviewed by Dan Bernstein.
527
528         Get rid of timestamps in UpdateInfo
529         https://bugs.webkit.org/show_bug.cgi?id=53713
530
531         Add a 64-bit sequence number to all DrawingAreaProxy messages, and use it to
532         check whether Update messages should be handled or not.
533
534         * Shared/UpdateInfo.cpp:
535         (WebKit::UpdateInfo::encode):
536         (WebKit::UpdateInfo::decode):
537         * Shared/UpdateInfo.h:
538         (WebKit::UpdateInfo::UpdateInfo):
539         * UIProcess/BackingStore.cpp:
540         (WebKit::BackingStore::BackingStore):
541         (WebKit::BackingStore::incorporateUpdate):
542         * UIProcess/BackingStore.h:
543         * UIProcess/DrawingAreaProxy.h:
544         (WebKit::DrawingAreaProxy::update):
545         (WebKit::DrawingAreaProxy::didSetSize):
546         (WebKit::DrawingAreaProxy::enterAcceleratedCompositingMode):
547         (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
548         * UIProcess/DrawingAreaProxy.messages.in:
549         * UIProcess/DrawingAreaProxyImpl.cpp:
550         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
551         (WebKit::DrawingAreaProxyImpl::update):
552         (WebKit::DrawingAreaProxyImpl::didSetSize):
553         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
554         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
555         * UIProcess/DrawingAreaProxyImpl.h:
556         * WebProcess/WebPage/DrawingAreaImpl.cpp:
557         (WebKit::generateSequenceNumber):
558         (WebKit::DrawingAreaImpl::setSize):
559         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
560         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
561         (WebKit::DrawingAreaImpl::display):
562
563 2011-02-03  Anders Carlsson  <andersca@apple.com>
564
565         Reviewed by Darin Adler.
566
567         Don't send enter/exit accelerated compositing mode messages when handling setSize
568         https://bugs.webkit.org/show_bug.cgi?id=53706
569
570         Don't send EnterAcceleratedCompositingMode/ExitAcceleratedCompositing mode when
571         the mode changes happen as a result of relayout in setSize, since an updated state
572         is going to be sent back in the DidSetSize message.
573         
574         * UIProcess/DrawingAreaProxyImpl.cpp:
575         (WebKit::DrawingAreaProxyImpl::didSetSize):
576         Add an assert.
577
578         * WebProcess/WebPage/DrawingAreaImpl.cpp:
579         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
580         Initialize m_inSetSize.
581
582         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
583         Factor out code into enterAcceleratedCompositingMode and exitAcceleratedCompositingMode.
584
585         (WebKit::DrawingAreaImpl::setSize):
586         Set m_inSetSize to true while handling setSize.
587
588         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
589         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
590         Take over the message sending responsibility from LayerTreeHostMac, and don't send messages
591         if we're currently handling a SetSize message.
592
593         * WebProcess/WebPage/DrawingAreaImpl.h:
594         Add m_inSetSize.
595
596         * WebProcess/WebPage/LayerTreeHost.h:
597         Add layerTreeHost getter.
598
599         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
600         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
601         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
602         Don't send EnterAcceleratedCompositingMode messages.
603
604         (WebKit::LayerTreeHostMac::layerTreeContext):
605         Add getter for the current layer tree context.
606
607         (WebKit::LayerTreeHostMac::invalidate):
608         Don't send ExitAcceleratedCompositingMode messages.
609
610 2011-02-03  Anders Carlsson  <andersca@apple.com>
611
612         Reviewed by Sam Weinig.
613
614         Make the layer tree host keep track of the layer tree context
615         https://bugs.webkit.org/show_bug.cgi?id=53698
616
617         Add a LayerTreeContext member variable to the LayerTreeHost object,
618         and also add a seed count to the LayerTreeContext so we can keep track of 
619         how layer tree contexts relate to each other.
620
621         * Shared/LayerTreeContext.h:
622         * Shared/mac/LayerTreeContextMac.mm:
623         (WebKit::LayerTreeContext::LayerTreeContext):
624         (WebKit::LayerTreeContext::makeWithSeed):
625         (WebKit::LayerTreeContext::encode):
626         (WebKit::LayerTreeContext::decode):
627
628         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
629         Add the layer tree context as a member variable.
630
631         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
632         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
633         Initialize the layer tree context.
634
635 2011-02-03  Sam Weinig  <sam@webkit.org>
636
637         Fix Qt build.
638
639         * UIProcess/API/qt/qwkpage.cpp:
640         (QWKPage::QWKPage):
641
642 2011-02-02  Sam Weinig  <sam@webkit.org>
643
644         Reviewed by Anders Carlsson.
645
646         Add notification of the end of a rubber band.
647         <rdar://problem/8940648>
648
649         * UIProcess/API/C/WKPage.h:
650         * UIProcess/WebPageProxy.cpp:
651         (WebKit::WebPageProxy::drawHeader):
652         (WebKit::WebPageProxy::drawFooter):
653         (WebKit::WebPageProxy::didCompleteRubberBandForMainFrame):
654         * UIProcess/WebPageProxy.h:
655         * UIProcess/WebPageProxy.messages.in:
656         * UIProcess/WebUIClient.cpp:
657         (WebKit::WebUIClient::didCompleteRubberBandForMainFrame):
658         * UIProcess/WebUIClient.h:
659         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
660         (WebKit::WebChromeClient::didCompleteRubberBandForMainFrame):
661         * WebProcess/WebCoreSupport/WebChromeClient.h:
662         Pipe the notification up to the WKUIClient.
663
664 2011-02-03  Sheriff Bot  <webkit.review.bot@gmail.com>
665
666         Unreviewed, rolling out r77449.
667         http://trac.webkit.org/changeset/77449
668         https://bugs.webkit.org/show_bug.cgi?id=53663
669
670         causes many WebKit2 tests to crash (Requested by othermaciej
671         on #webkit).
672
673         * Shared/API/c/WKSharedAPICast.h:
674         (WebKit::toAPI):
675         (WebKit::toCopiedAPI):
676         (WebKit::toURLRef):
677         (WebKit::toCopiedURLAPI):
678         * Shared/WebString.h:
679         (WebKit::WebString::isNull):
680         (WebKit::WebString::WebString):
681
682 2011-02-02  Sam Weinig  <sam@webkit.org>
683
684         Fix license block issues pointed out by Daniel Bates.
685
686         * Shared/API/c/WKGraphicsContext.cpp:
687         * Shared/API/c/WKGraphicsContext.h:
688         * Shared/API/c/cg/WKGraphicsContextCG.cpp:
689         * Shared/API/c/cg/WKGraphicsContextCG.h:
690         * Shared/WebGraphicsContext.cpp:
691
692 2011-02-02  Sam Weinig  <sam@webkit.org>
693
694         Reviewed by Dan Bernstein.
695
696         Add WKBundleFrameGetVisibleContentBoundsExcludingScrollbars API for WebKit2.
697
698         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
699         (WKBundleFrameGetContentBounds):
700         (WKBundleFrameGetVisibleContentBounds):
701         (WKBundleFrameGetVisibleContentBoundsExcludingScrollbars):
702         (WKBundleFrameGetScrollOffset):
703         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
704         * WebProcess/WebPage/WebFrame.cpp:
705         (WebKit::WebFrame::contentBounds):
706         (WebKit::WebFrame::visibleContentBounds):
707         (WebKit::WebFrame::visibleContentBoundsExcludingScrollbars):
708         (WebKit::WebFrame::scrollOffset):
709         * WebProcess/WebPage/WebFrame.h:
710         Move implementation of frame geometry to the implementation file
711         instead of keeping it in the API file.
712
713 2011-02-02  Stephanie Lewis  <slewis@apple.com>
714
715         Reviewed by Geoff Garen.
716
717         https://bugs.webkit.org/show_bug.cgi?id=53361
718         <rdar://problem/8921729> REGRESSION: Membuster accumulates 1GB+ memory due to autorelease 
719         pools not being drained.
720         Call into AppKit to add observers that push and pop autorelease pools on entry 
721         and exit from the CFRunLoop.  This will prevent memory from accumulating.
722
723         * WebProcess/mac/WebProcessMainMac.mm:
724         (WebKit::WebProcessMain):
725
726 2011-02-02  Darin Adler  <darin@apple.com>
727
728         Reviewed by Sam Weinig.
729
730         Make null WTF::String objects turn into 0 pointers for WKStringRef and WKURLRef.
731         rdar://problem/8948688
732
733         * Shared/API/c/WKSharedAPICast.h:
734         (WebKit::toAPI): Return 0 if the passed in string is 0.
735         (WebKit::toCopiedAPI): Ditto.
736         (WebKit::toURLRef): Ditto. Old code was trying to do this but was missing a return.
737         (WebKit::toCopiedURLAPI): Ditto. Old code was trying to do this but had incorrect
738         nll check.
739
740         * Shared/WebString.h: Removed isNull function. It can never return true.
741         Removed constructor code that turns the null string into the empty string.
742         Instead assert that the passed in string is not null.
743
744 2011-02-02  Mark Rowe  <mrowe@apple.com>
745
746         Reviewed by Beth Dakin.
747
748         <rdar://problem/8928367> Crash when loading canvas pages inside HTMLCanvasElement::createImageBuffer().
749
750         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
751         (InitWebCoreSystemInterface): Add some missing initializers.
752
753 2011-02-02  Sam Weinig  <sam@webkit.org>
754
755         Reviewed by Beth Dakin.
756
757         Add ChromeClient function to paint custom overhang areas.
758         https://bugs.webkit.org/show_bug.cgi?id=53639
759
760         * Shared/API/c/WKBase.h:
761         * Shared/API/c/WKGraphicsContext.cpp: Added.
762         (WKGraphicsContextGetTypeID):
763         * Shared/API/c/WKGraphicsContext.h: Added.
764         * Shared/API/c/WKSharedAPICast.h:
765         * Shared/API/c/cg/WKGraphicsContextCG.cpp: Added.
766         (WKGraphicsContextGetCGContext):
767         * Shared/API/c/cg/WKGraphicsContextCG.h: Added.
768         * Shared/APIObject.h:
769         * Shared/WebGraphicsContext.cpp: Added.
770         (WebKit::WebGraphicsContext::WebGraphicsContext):
771         * Shared/WebGraphicsContext.h: Added.
772         (WebKit::WebGraphicsContext::create):
773         (WebKit::WebGraphicsContext::platformContext):
774         (WebKit::WebGraphicsContext::type):
775         Add WebGraphicsContext API type.
776
777         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
778         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
779         (WebKit::InjectedBundlePageUIClient::pageDidScroll):
780         (WebKit::InjectedBundlePageUIClient::shouldPaintCustomOverhangArea):
781         (WebKit::InjectedBundlePageUIClient::paintCustomOverhangArea):
782         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
783         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
784         (WebKit::WebChromeClient::paintCustomOverhangArea):
785         * WebProcess/WebCoreSupport/WebChromeClient.h:
786         Pipe paintCustomOverhangArea to the InjectedBundlePageUIClient.
787
788         * UIProcess/API/C/WebKit2.h:
789         * WebKit2.pro:
790         * WebKit2.xcodeproj/project.pbxproj:
791         * win/WebKit2.vcproj:
792         * win/WebKit2Generated.make:
793         Add new files.
794
795 2011-02-02  Anders Carlsson  <andersca@apple.com>
796
797         Reviewed by Dan Bernstein.
798
799         Work towards making the layer tree host be in charge of all painting
800         https://bugs.webkit.org/show_bug.cgi?id=53636
801
802         Make sure that DrawingAreaImpl::display is never called when in accelerated compositing mode,
803         since the layer tree host is supposed to handle all drawing in that case.
804
805         * WebProcess/WebPage/DrawingAreaImpl.cpp:
806         (WebKit::DrawingAreaImpl::scroll):
807         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
808         (WebKit::DrawingAreaImpl::setSize):
809         (WebKit::DrawingAreaImpl::didUpdate):
810
811 2011-02-02  Mark Rowe  <mrowe@apple.com>
812
813         Fix the 32-bit build.
814
815         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
816         (WebKit::computeFakeWindowBoundsRect):
817
818 2011-02-02  Anders Carlsson  <andersca@apple.com>
819
820         Reviewed by Sam Weinig.
821
822         Make sure that we don't try to call display() when in accelerated compositing mode
823         https://bugs.webkit.org/show_bug.cgi?id=53629
824
825         When in accelerated compositing mode, the layer tree host should handle all painting, so make sure that display() is never called.
826
827         * WebProcess/WebPage/DrawingAreaImpl.cpp:
828         (WebKit::DrawingAreaImpl::setNeedsDisplay):
829         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
830         (WebKit::DrawingAreaImpl::display):
831
832 2011-02-02  Adam Roben  <aroben@apple.com>
833
834         Assert WebBackForwardList's current index is valid to help catch errors
835
836         Hopefully this will help catch a crash I saw once but haven't yet been able to reproduce.
837
838         Fixes <http://webkit.org/b/53622>.
839
840         Reviewed by Brady Eidson.
841
842         * UIProcess/WebBackForwardList.cpp:
843         (WebKit::WebBackForwardList::WebBackForwardList):
844         (WebKit::WebBackForwardList::addItem):
845         (WebKit::WebBackForwardList::goToItem):
846         (WebKit::WebBackForwardList::currentItem):
847         (WebKit::WebBackForwardList::backItem):
848         (WebKit::WebBackForwardList::forwardItem):
849         (WebKit::WebBackForwardList::itemAtIndex):
850         (WebKit::WebBackForwardList::backListCount):
851         (WebKit::WebBackForwardList::forwardListCount):
852         (WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
853         (WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
854         (WebKit::WebBackForwardList::clear):
855         * UIProcess/cf/WebBackForwardListCF.cpp:
856         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
857         (WebKit::WebBackForwardList::restoreFromCFDictionaryRepresentation):
858         Assert that m_current is valid.
859
860         * UIProcess/WebBackForwardList.h: Moved the NoCurrentItemIndex to a static data member so
861         that it can be used from WebBackForwardListCF.cpp.
862
863 2011-02-02  Anders Carlsson  <andersca@apple.com>
864
865         Reviewed by Sam Weinig.
866
867         The drawing area proxy should keep track of the accelerated compositing state
868         https://bugs.webkit.org/show_bug.cgi?id=53624
869
870         * UIProcess/DrawingAreaProxyImpl.cpp:
871         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
872         Initialize m_isInAcceleratedCompositingMode to false.
873
874         (WebKit::DrawingAreaProxyImpl::paint):
875         Don't try to paint if we're in accelerated compositing mode.
876
877         (WebKit::DrawingAreaProxyImpl::didSetSize):
878         Bail if we're in accelerated compositing mode.
879
880         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
881         Set m_isInAcceleratedCompositingMode to true, null out the backing store.
882
883         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
884         Set m_isInAcceleratedCompositingMode back to false.
885
886         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
887         Assert that we're not in accelerated compositing mode.
888
889         * UIProcess/DrawingAreaProxyImpl.h:
890
891 2011-02-02  Timothy Hatcher  <timothy@apple.com>
892
893         Give the Web Process access to the Safari RSS preferences.
894
895         <rdar://problem/8916870> Sandbox violation related to RSS during initial
896         page load with WebKit2 (prevents RSS from working)
897
898         Reviewed by Darin Adler.
899
900         * WebProcess/com.apple.WebProcess.sb:
901
902 2011-02-02  Steve Lacey  <sjl@chromium.org>
903
904         Reviewed by Eric Carlson.
905
906         Implement basic media statistics on media elements.
907         https://bugs.webkit.org/show_bug.cgi?id=53322
908
909         * Configurations/FeatureDefines.xcconfig:
910
911 2011-02-01  Alexey Proskuryakov  <ap@apple.com>
912
913         Reviewed by Sam Weinig.
914
915         https://bugs.webkit.org/show_bug.cgi?id=53561
916         <rdar://problem/8900228> Stepping through print previews in WebKit2 mode steps in and out of
917         printing mode a lot
918
919         Disable NSView autodisplay, so that -[WKView drawRect:] isn't called (other than when
920         resizing the window), so that we don't have to switch modes all the time.
921
922         * UIProcess/API/mac/PageClientImpl.h:
923         * UIProcess/API/mac/PageClientImpl.mm:
924         (WebKit::PageClientImpl::setAutodisplay):
925         * UIProcess/PageClient.h:
926         * UIProcess/WebPageProxy.cpp:
927         (WebKit::WebPageProxy::setAutodisplay):
928         * UIProcess/WebPageProxy.h:
929         Pipe the call from WKPrintingView down to WKView.
930
931         * UIProcess/API/mac/WKPrintingView.mm:
932         (-[WKPrintingView beginDocument]): Added. We don't want to autodisplay WKView while printing,
933         because layout is changed to print at the time, and drawing to screen requires relayout.
934         
935         (-[WKPrintingView endDocument]): When not printing, turn autodisplay back on. Also, call
936         -[super endDocument] for unknown but definitive good (oops!).
937
938 2011-02-02  David Hyatt  <hyatt@apple.com>
939
940         Reviewed by Darin Adler.
941
942         Conversion of right()/bottom() to maxX()/maxY() as part of the removal of those accessors.
943
944         * UIProcess/win/WebPopupMenuProxyWin.cpp:
945         (WebKit::WebPopupMenuProxyWin::calculatePositionAndSize):
946         * UIProcess/win/WebView.cpp:
947         (WebKit::WebView::prepareCandidateWindow):
948         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
949         (WebKit::NetscapePlugin::platformGeometryDidChange):
950
951 2011-02-01  Darin Adler  <darin@apple.com>
952
953         Reviewed by Anders Carlsson.
954
955         Overflow in WebKit2 argument decoder buffer checking
956         https://bugs.webkit.org/show_bug.cgi?id=53536
957
958         * Platform/CoreIPC/ArgumentDecoder.cpp:
959         (CoreIPC::roundUpToAlignment): Tweak code a bit for clarity and to replace
960         C casts with C++ casts.
961         (CoreIPC::ArgumentDecoder::alignBufferPosition): Rearrange buffer calculation
962         so we don't do any math with the passed-in size, because that could overflow.
963         (CoreIPC::ArgumentDecoder::bufferIsLargeEnoughToContain): Ditto.
964
965 2011-02-01  Csaba Osztrogonác  <ossy@webkit.org>
966
967         Unreviewed.
968
969         Fix Qt build after r77339.
970
971         * UIProcess/API/qt/qwkpage.cpp:
972         (QWKPagePrivate::enterAcceleratedCompositingMode):
973         (QWKPagePrivate::exitAcceleratedCompositingMode):
974         * UIProcess/API/qt/qwkpage_p.h:
975
976 2011-02-01  Anders Carlsson  <andersca@apple.com>
977
978         Reviewed by Dan Bernstein.
979
980         Attach the layer tree in the UI process
981         https://bugs.webkit.org/show_bug.cgi?id=53560
982
983         * UIProcess/API/mac/WKView.mm:
984         (-[WKView _enterAcceleratedCompositingMode:]):
985         Make a render layer and add it as a sublayer of our root layer.
986
987         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
988         Make LayerTreeHostMac a GraphicsLayerClient.
989
990         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
991         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
992         Create a root layer, add the layer subtree as a child of the root layer.
993
994         (WebKit::LayerTreeHostMac::~LayerTreeHostMac):
995         Assert that m_rootLayer is null.
996
997         (WebKit::LayerTreeHostMac::invalidate):
998         Null out m_rootLayer.
999
1000         (WebKit::LayerTreeHostMac::notifyAnimationStarted):
1001         (WebKit::LayerTreeHostMac::notifySyncRequired):
1002         (WebKit::LayerTreeHostMac::paintContents):
1003         Add stubs.
1004
1005         (WebKit::LayerTreeHostMac::showDebugBorders):
1006         (WebKit::LayerTreeHostMac::showRepaintCounter):
1007         Return the correct settings.
1008
1009         (WebKit::LayerTreeHostMac::flushPendingLayerChanges):
1010         Flush the root layer changes.
1011
1012 2011-02-01  Anders Carlsson  <andersca@apple.com>
1013
1014         Fix Windows build.
1015
1016         * UIProcess/win/WebView.cpp:
1017         (WebKit::WebView::enterAcceleratedCompositingMode):
1018         (WebKit::WebView::exitAcceleratedCompositingMode):
1019         * UIProcess/win/WebView.h:
1020
1021 2011-02-01  Anders Carlsson  <andersca@apple.com>
1022
1023         Reviewed by Dan Bernstein.
1024
1025         Add a layer backed NSView for accelerated content
1026         https://bugs.webkit.org/show_bug.cgi?id=53555
1027
1028         Rename the current _layerHostingView to _oldLayerHostingView and
1029         add a new _layerHostingView to be used with the new drawing area.
1030
1031         * UIProcess/API/mac/WKView.mm:
1032         (-[WKView hitTest:]):
1033         (-[WKView _startAcceleratedCompositing:]):
1034         (-[WKView _stopAcceleratedCompositing]):
1035         (-[WKView _enterAcceleratedCompositingMode:]):
1036         (-[WKView _exitAcceleratedCompositingMode]):
1037
1038 2011-02-01  Anders Carlsson  <andersca@apple.com>
1039
1040         Reviewed by Dan Bernstein.
1041
1042         Pass enter/exit accelerated compositing mode to the WKView
1043         https://bugs.webkit.org/show_bug.cgi?id=53552
1044
1045         * UIProcess/API/mac/PageClientImpl.h:
1046         * UIProcess/API/mac/PageClientImpl.mm:
1047         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
1048         (WebKit::PageClientImpl::exitAcceleratedCompositingMode):
1049         * UIProcess/API/mac/WKView.mm:
1050         (-[WKView _enterAcceleratedCompositingMode:]):
1051         (-[WKView _exitAcceleratedCompositingMode]):
1052         * UIProcess/API/mac/WKViewInternal.h:
1053         * UIProcess/DrawingAreaProxyImpl.cpp:
1054         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
1055         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
1056         * UIProcess/PageClient.h:
1057         * UIProcess/WebPageProxy.cpp:
1058         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
1059         (WebKit::WebPageProxy::exitAcceleratedCompositingMode):
1060         * UIProcess/WebPageProxy.h:
1061
1062 2011-02-01  Csaba Osztrogonác  <ossy@webkit.org>
1063
1064         Unreviewed Qt buildfix after r77286.
1065
1066         https://bugs.webkit.org/show_bug.cgi?id=53520 
1067         Remove the physical terminology from IntRect and FloatRect.
1068
1069         * UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp:
1070         (WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore):
1071
1072 2011-02-01  Anders Carlsson  <andersca@apple.com>
1073
1074         Reviewed by Adam Roben.
1075
1076         Send messages when entering/exiting accelerated compositing
1077         https://bugs.webkit.org/show_bug.cgi?id=53534
1078
1079         * Shared/LayerTreeContext.h: Added.
1080         * Shared/mac/LayerTreeContextMac.mm: Added.
1081         Add new LayerTreeContext which holds all information needed to enter
1082         accelerated compositing mode.
1083
1084         * UIProcess/DrawingAreaProxy.h:
1085         (WebKit::DrawingAreaProxy::enterAcceleratedCompositingMode):
1086         (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
1087         Add empty stubs.
1088
1089         * UIProcess/DrawingAreaProxy.messages.in:
1090         Add new messgaes.
1091
1092         * UIProcess/DrawingAreaProxyImpl.cpp:
1093         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
1094         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
1095         * UIProcess/DrawingAreaProxyImpl.h:
1096         Add empty stubs.
1097
1098         * WebKit2.xcodeproj/project.pbxproj:
1099         Add new files.
1100
1101         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
1102         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1103         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
1104         (WebKit::LayerTreeHostMac::invalidate):
1105         Send messages.
1106
1107 2011-02-01  Alexey Proskuryakov  <ap@apple.com>
1108
1109         Reviewed by Dan Bernstein and Darin Adler.
1110
1111         <rdar://problem/8830594> Printed page is sometimes shifted down, making footer invisible
1112
1113         * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView locationOfPrintRect:]): Instead of
1114         letting AppKit compute content position on page, make the view provide it. We can do this
1115         because WK(Printing)Views are always printed on their own, not as part of other views.
1116
1117 2011-02-01  Anders Carlsson  <andersca@apple.com>
1118
1119         Reviewed by Adam Roben.
1120
1121         Make LayerTreeHost ref counted
1122         https://bugs.webkit.org/show_bug.cgi?id=53530
1123
1124         LayerTreeHostMac will soon be able to trigger layout, which could cause
1125         the page to leave accelerated compositing mode and free the LayerTreeHostMac object.
1126
1127         Making LayerTreeHost ref counted will let LayerTreeHostMac protect itself while triggering layout.
1128
1129         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1130         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
1131         * WebProcess/WebPage/DrawingAreaImpl.h:
1132         * WebProcess/WebPage/LayerTreeHost.cpp:
1133         (WebKit::LayerTreeHost::create):
1134         * WebProcess/WebPage/LayerTreeHost.h:
1135         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
1136         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1137         (WebKit::LayerTreeHostMac::create):
1138         (WebKit::LayerTreeHostMac::LayerTreeHostMac):
1139         (WebKit::LayerTreeHostMac::~LayerTreeHostMac):
1140         (WebKit::LayerTreeHostMac::invalidate):
1141
1142 2011-02-01  Sam Weinig  <sam@webkit.org>
1143
1144         Reviewed by Beth Dakin.
1145
1146         Part 2 for <rdar://problem/8492788>
1147         Adopt WKScrollbarPainterController
1148
1149         Use header detection to define scrollbar painting controller #define.
1150
1151         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1152         (InitWebCoreSystemInterface):
1153
1154 2011-02-01  David Hyatt  <hyatt@apple.com>
1155
1156         Reviewed by Oliver Hunt.
1157
1158         https://bugs.webkit.org/show_bug.cgi?id=53520
1159         
1160         Remove the physical terminology from IntRect and FloatRect.
1161         
1162         Now that we have flipped RenderBlocks for vertical-rl and horizontal-bt writing modes,
1163         we need to update our terminology to be more accurate.
1164
1165         I'm borrowing a page from AppKit here (which also supports flipped NSViews) and
1166         renaming right() and bottom() to maxX() and maxY().  These terms remain accurate
1167         even for flipped rectangles.
1168
1169         * Platform/Region.cpp:
1170         (WebKit::Region::Shape::Shape):
1171         * UIProcess/API/mac/WKPrintingView.mm:
1172         (pageDidComputePageRects):
1173         * UIProcess/FindIndicator.cpp:
1174         (WebKit::FindIndicator::draw):
1175         * UIProcess/TiledDrawingAreaProxy.cpp:
1176         (WebKit::TiledDrawingAreaProxy::invalidate):
1177         (WebKit::TiledDrawingAreaProxy::paint):
1178         (WebKit::TiledDrawingAreaProxy::createTiles):
1179         * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
1180         (WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore):
1181         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1182         (WebKit::NetscapePlugin::callSetWindow):
1183
1184 2011-02-01  Anders Carlsson  <andersca@apple.com>
1185
1186         Reviewed by Adam Roben.
1187
1188         Move flushPendingLayerChanges to LayerTreeHostMac
1189         https://bugs.webkit.org/show_bug.cgi?id=53525
1190
1191         In preparation for adding more Mac specific code to flushPendingLayerChanges.
1192
1193         * WebProcess/WebPage/LayerTreeHost.cpp:
1194         * WebProcess/WebPage/LayerTreeHost.h:
1195         * WebProcess/WebPage/mac/LayerTreeHostMac.h:
1196         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1197         (WebKit::LayerTreeHostMac::flushPendingLayerChanges):
1198
1199 2011-02-01  Beth Dakin  <bdakin@apple.com>
1200
1201         Reviewed by Sam Weinig.
1202
1203         Fix for <rdar://problem/8492788> Adopt WKScrollbarPainterController
1204
1205         Implement NSView's viewWillStartLiveResize and
1206         viewDidEndLiveResize and propagate the messages down
1207         to WebCore.
1208         * UIProcess/API/mac/WKView.mm:
1209         (-[WKView viewWillStartLiveResize]):
1210         (-[WKView viewDidEndLiveResize]):
1211         * UIProcess/WebPageProxy.cpp:
1212         (WebKit::WebPageProxy::viewWillStartLiveResize):
1213         (WebKit::WebPageProxy::viewWillEndLiveResize):
1214         * UIProcess/WebPageProxy.h:
1215         * WebProcess/WebPage/WebPage.cpp:
1216         (WebKit::WebPage::viewWillStartLiveResize):
1217         (WebKit::WebPage::viewWillEndLiveResize):
1218         * WebProcess/WebPage/WebPage.h:
1219         * WebProcess/WebPage/WebPage.messages.in:
1220
1221         A bunch of new WebKitSystemInterface functions.
1222         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1223         (InitWebCoreSystemInterface):
1224
1225 2011-02-01  Dave Hyatt  <hyatt@apple.com>
1226
1227         Reviewed by Darin Adler.
1228
1229         https://bugs.webkit.org/show_bug.cgi?id=46422, make printing and pagination work
1230         with vertical text.
1231
1232         Change printing functions to check writing-mode and properly swap width and height
1233         as needed.
1234
1235         * WebProcess/WebPage/WebPage.cpp:
1236         (WebKit::WebPage::computePagesForPrinting):
1237
1238 2011-01-31  Alexey Proskuryakov  <ap@apple.com>
1239
1240         Reviewed by Maciej Stachowiak.
1241
1242         https://bugs.webkit.org/show_bug.cgi?id=53466
1243         Move WebKit2 to printing via API methods
1244
1245         Also fixes <rdar://problem/8933724> REGRESSION: Wrong pages are printed when not printing from page 1
1246
1247         Also fixes horizontal tiling (no bug filed).
1248
1249         The main idea here is that we don't force AppKit to use a different scaling factor when
1250         a Web view can't be resized to exact page size, and scale when drawing instead.
1251
1252         * UIProcess/API/mac/WKPrintingView.mm:
1253         (-[WKPrintingView _firstPrintedPageNumber]): Factored out into a separate method.
1254         (-[WKPrintingView _lastPrintedPageNumber]): Ditto.
1255         (pageDidDrawToPDF): Avoid crashing if data is null.
1256         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Use -_firstPrintedPageNumber
1257         and -_lastPrintedPageNumber.
1258         (pageDidComputePageRects): Set frame size to what it would have been for a normal NSView
1259         that's been asked to resize.
1260         (-[WKPrintingView _pageForRect:]): Check x(), because several pages can be at the same y()
1261         when tiling horizontally.
1262         (-[WKPrintingView _drawPDFDocument:page:atPoint:]): Point to draw at and frame size are
1263         now using different units, translate as appropriate.
1264         (-[WKPrintingView _drawPreview:]): Scale the rect to WebCore units.
1265         (-[WKPrintingView drawRect:]): Correctly calculate page number when the first page to print
1266         isn't page 1.
1267         (-[WKPrintingView rectForPage:]): Scale the rect to AppKit units.
1268
1269 2011-01-31  Darin Adler  <darin@apple.com>
1270
1271         Reviewed by Adele Peterson.
1272
1273         WKView should support scrollPageDown:, scrollPageUp:, scrollToBeg and other similar selectors
1274         https://bugs.webkit.org/show_bug.cgi?id=53460
1275
1276         * UIProcess/API/mac/WKView.mm: Added WEBCORE_COMMAND macro for lots of editor commands that
1277         are implemented in WebCore so they will get forwarded. Many of these will probably work without
1278         any further changes required. Added comments about the methods that we do not yet forward.
1279         (createSelectorExceptionMap): Map scrollPageDown: to ScrollPageForward and
1280         scrollPageUp: to ScrollPageBackward because we want the page up and page down
1281         keys to follow the document logical order, not physical order. This is equivalent
1282         to what we do in WebPage::performDefaultBehaviorForKeyEvent.
1283
1284 2011-01-31  Jessie Berlin  <jberlin@apple.com>
1285
1286         Reviewed by Steve Falkenburg.
1287
1288         WebKit2: the cookies used by the WebKit2 Web Process should not go in a top-level
1289         directory.
1290         https://bugs.webkit.org/show_bug.cgi?id=53278
1291
1292         Use the name WebKit2WebProcess since the default location for the cookies is determined
1293         based on the process name (which is WebKit2WebProcess.exe on Windows).
1294
1295         * win/WebKit2.make:
1296         Copy the WebKit2WebProcess.resources directory into the AppleInternal bin.
1297
1298         * win/WebKit2WebProcess.resources: Added.
1299         * win/WebKit2WebProcess.resources/Info.plist: Added.
1300         Copied from the WebKit version of Info.plist.
1301
1302         * win/WebKit2WebProcessPostBuild.cmd:
1303         Copy the WebKit2WebProcess.resources directory into the WebKitOutPutDir's bin.
1304
1305 2011-01-31  Anders Carlsson  <andersca@apple.com>
1306
1307         Reviewed by Adam Roben.
1308
1309         Make LayerTreeHost an abstract base class and make LayerTreeHostMac inherit from it
1310         https://bugs.webkit.org/show_bug.cgi?id=53432
1311
1312         * WebKit2.xcodeproj/project.pbxproj:
1313         Add LayerTreeHostMac.h.
1314
1315         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1316         * WebProcess/WebPage/DrawingAreaImpl.h:
1317         Make m_layerTreeHost an OwnPtr and initialize/destroy it appropriately.
1318
1319         * WebProcess/WebPage/LayerTreeHost.cpp:
1320         (WebKit::LayerTreeHost::create):
1321         On Mac, create a LayerTreeHostMac instance.
1322
1323         (WebKit::LayerTreeHost::~LayerTreeHost):
1324         No need to call platformInvalidate anymore.
1325
1326         * WebProcess/WebPage/LayerTreeHost.h:
1327         * WebProcess/WebPage/mac/LayerTreeHostMac.h: Added.
1328         * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
1329         (WebKit::LayerTreeHostMac::~LayerTreeHostMac):
1330         Invalidate the run loop observer here instead of in platformInvalidate.
1331
1332         (WebKit::LayerTreeHostMac::scheduleLayerFlush):
1333         (WebKit::LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback):
1334         These are now members of LayerTreeHostMac.
1335
1336 2011-01-30  Geoffrey Garen  <ggaren@apple.com>
1337
1338         Reviewed by Sam Weinig.
1339
1340         [Take 2!]
1341         Fixed crash on window close (maybe crash on launch?) due to missing frame null checks
1342         https://bugs.webkit.org/show_bug.cgi?id=53408
1343
1344         * UIProcess/WebContext.cpp:
1345         (WebKit::WebContext::didNavigateWithNavigationData):
1346         (WebKit::WebContext::didPerformClientRedirect):
1347         (WebKit::WebContext::didPerformServerRedirect):
1348         (WebKit::WebContext::didUpdateHistoryTitle): Use MESSAGE_CHECK because
1349         we don't think we should be able to reach this state under normal conditions.
1350
1351 2011-01-30  Geoffrey Garen  <ggaren@apple.com>
1352
1353         Reviewed by Maciej Stachowiak.
1354
1355         Fixed crash on window close (maybe crash on launch?) due to missing
1356         frame null checks
1357         https://bugs.webkit.org/show_bug.cgi?id=53408
1358
1359         * UIProcess/WebContext.cpp:
1360         (WebKit::WebContext::didNavigateWithNavigationData):
1361         (WebKit::WebContext::didPerformClientRedirect):
1362         (WebKit::WebContext::didPerformServerRedirect):
1363         (WebKit::WebContext::didUpdateHistoryTitle): Check for NULL, since we're
1364         calling a function that can return it.
1365
1366 2011-01-30  Balazs Kelemen  <kbalazs@webkit.org>
1367
1368         Reviewed by Csaba Osztrogonác.
1369
1370         [Qt][WK2]REGRESSION (r76991): Fix build errors
1371         https://bugs.webkit.org/show_bug.cgi?id=53400
1372
1373         Revert the temporary build fix (http://trac.webkit.org/changeset/77088)
1374         and remove WebKit2Prefix.h from the build.
1375         * UIProcess/API/qt/qwkhistory.h:
1376         * UIProcess/API/qt/qwkpage.h:
1377         * WebKit2.pro:
1378
1379 2011-01-30  Jeff Miller  <jeffm@apple.com>
1380
1381         Reviewed by Dan Bernstein.
1382
1383         FindController::updateFindIndicator() crashes if selection isn't visible
1384         https://bugs.webkit.org/show_bug.cgi?id=53399
1385
1386         * WebProcess/WebPage/FindController.cpp:
1387         (WebKit::FindController::updateFindIndicator): Return false if ShareableBitmap::createShareable() returns null (typically because the selection rect is empty).
1388
1389 2011-01-30  Csaba Osztrogonác  <ossy@webkit.org>
1390
1391         Unreviewed.
1392
1393         [Qt][WK2] Buildfix.
1394
1395         * UIProcess/API/qt/qwkhistory.h:
1396         * UIProcess/API/qt/qwkpage.h:
1397
1398 2011-01-29  Maciej Stachowiak  <mjs@apple.com>
1399
1400         Reviewed by Geoffrey Garen.
1401
1402         Add WKPageCopyPendingAPIRequestURL API
1403         https://bugs.webkit.org/show_bug.cgi?id=53383
1404
1405         This API returns the last URL requested for load via API, if neither that load nor any
1406         other load subsequently reaches the provisional state.
1407         
1408         This is useful to be able to track loads initiated via the API
1409         
1410         * UIProcess/API/C/WKPage.cpp:
1411         (WKPageCopyPendingAPIRequestURL): Retrieve the pending URL.
1412         * UIProcess/API/C/WKPage.h:
1413         * UIProcess/WebPageProxy.cpp:
1414         (WebKit::WebPageProxy::loadURL): Set pending URL.
1415         (WebKit::WebPageProxy::loadURLRequest): ditto
1416         (WebKit::WebPageProxy::reload): ditto
1417         (WebKit::WebPageProxy::goForward): ditto
1418         (WebKit::WebPageProxy::goBack): ditto
1419         (WebKit::WebPageProxy::estimatedProgress): Assume the initial
1420         progress value when there is a pending URL.
1421         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Clear
1422         pending URL; clients should look at the provisional URL now.
1423         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Clear
1424         pending URL if it doesn't match the policy URL; this means we
1425         were interrupted by another load.
1426         * UIProcess/WebPageProxy.h:
1427         (WebKit::WebPageProxy::pendingAPIRequestURL): Helper function.
1428         (WebKit::WebPageProxy::clearPendingAPIRequestURL): ditto
1429         (WebKit::WebPageProxy::setPendingAPIRequestURL): ditto
1430
1431 2011-01-28  Jon Honeycutt  <jhoneycutt@apple.com>
1432
1433         Downloads in WK2 on Windows should write resume data to bundle
1434         https://bugs.webkit.org/show_bug.cgi?id=53282
1435         <rdar://problem/8753077>
1436
1437         Reviewed by Alice Liu.
1438
1439         * WebProcess/Downloads/Download.cpp:
1440         (WebKit::Download::decideDestinationWithSuggestedFilename):
1441         Call didDecideDestination(), now that the destination is decided.
1442
1443         * WebProcess/Downloads/Download.h:
1444         Declare didDecideDestination(). Added member variables to hold the
1445         destination file path and the download bundle path.
1446         (WebKit::Download::destination):
1447         Return the path to the final destination for this download.
1448
1449         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
1450         (WebKit::Download::start):
1451         Remove the name of an unused param.
1452         (WebKit::Download::startWithHandle):
1453         Ditto.
1454         (WebKit::Download::cancel):
1455         Tell CFNetwork not to delete the file upon failure, and tell it to
1456         cancel the download. Copy the resume data for the download, and append
1457         it to the download bundle. Call didCancel() with an empty
1458         DataReference, since we have written our own resume data.
1459         (WebKit::decideDestinationWithSuggestedObjectNameCallback):
1460         Remove some unused param names. Removed the call to
1461         CFURLDownloadSetDestination() - this is now handled in
1462         Download::didDecideDestination().
1463         (WebKit::didCreateDestinationCallback):
1464         Report that the final destination was created, rather than the download
1465         bundle, matching old WebKit.
1466         (WebKit::Download::didDecideDestination):
1467         Store the final destination and the download bundle paths, and call
1468         CFURLDownloadSetDestination(), passing the path to the download bundle.
1469
1470         * WebProcess/Downloads/curl/DownloadCurl.cpp:
1471         (WebKit::Download::didDecideDestination):
1472         Stubbed.
1473
1474         * WebProcess/Downloads/mac/DownloadMac.mm:
1475         (WebKit::Download::didDecideDestination):
1476         Stubbed - unneeded on the Mac.
1477
1478         * WebProcess/Downloads/qt/DownloadQt.cpp:
1479         (WebKit::Download::didDecideDestination):
1480         Stubbed.
1481
1482 2011-01-29  Jeff Miller  <jeffm@apple.com>
1483
1484         Reviewed by Anders Carlsson.
1485
1486         Support find bouncy in WebKit2 on Windows
1487         https://bugs.webkit.org/show_bug.cgi?id=53329
1488         <rdar://problem/8565843>
1489         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.
1490         Add infrastructure to call back into the app when the find indicator changes.
1491
1492         * UIProcess/API/C/win/WKView.cpp: Cleanup some code style violations.
1493         (WKViewSetFindIndicatorCallback): Added.
1494         (WKViewGetFindIndicatorCallback): Added.
1495         * UIProcess/API/C/win/WKView.h: Cleanup some code style violations.
1496         * UIProcess/FindIndicator.cpp:
1497         (WebKit::FindIndicator::create):
1498         (WebKit::FindIndicator::FindIndicator):
1499         (WebKit::FindIndicator::frameRect):
1500         (WebKit::FindIndicator::draw):
1501         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.
1502         * UIProcess/FindIndicator.h:
1503         (WebKit::FindIndicator::selectionRectInWindowCoordinates): Added.
1504         (WebKit::FindIndicator::textRects): Rename m_textRects to m_textRectsInSelectionRectCoordinates.
1505         * UIProcess/WebPageProxy.cpp:
1506         (WebKit::WebPageProxy::setFindIndicator): Rename selectionRect to selectionRectInWindowCoordinates and textRects to textRectsInSelectionRectCoordinates to be more explict about the coordinate system.
1507         * UIProcess/WebPageProxy.h: Ditto.
1508         * UIProcess/win/WebView.cpp:
1509         (WebKit::WebView::WebView):
1510         (WebKit::WebView::setFindIndicator): Added.
1511         (WebKit::WebView::setFindIndicatorCallback): Added.
1512         (WebKit::WebView::getFindIndicatorCallback): Added.
1513         * UIProcess/win/WebView.h:
1514
1515 2011-01-28  Alexey Proskuryakov  <ap@apple.com>
1516
1517         Reviewed by Dan Bernstein.
1518
1519         https://bugs.webkit.org/show_bug.cgi?id=53367
1520         <rdar://problem/8926460> Remove dysfunctional code from -[WKPrintingView _isPrintingPreview].
1521
1522         * UIProcess/API/mac/WKPrintingView.mm: (-[WKPrintingView _isPrintingPreview]): The common
1523         branch works fine for now, no need to make platforms different.
1524
1525 2011-01-28  Maciej Stachowiak  <mjs@apple.com>
1526
1527         Reviewed by Dan Bernstein.
1528
1529         WKPageGetEstimatedProgress returns wrong value after a mainframe provisional load has started
1530         https://bugs.webkit.org/show_bug.cgi?id=53358
1531
1532         * UIProcess/WebPageProxy.cpp:
1533         (WebKit::WebPageProxy::didStartProgress): Start progress at the magic initial value, not 0.
1534
1535 2011-01-28  Anders Carlsson  <andersca@apple.com>
1536
1537         Yet another build fix (What was I thinking?)
1538
1539         * WebProcess/Downloads/Download.h:
1540         * WebProcess/Plugins/PluginProxy.h:
1541
1542 2011-01-28  Anders Carlsson  <andersca@apple.com>
1543
1544         Fix Windows build.
1545
1546         * Shared/PrintInfo.h:
1547
1548 2011-01-28  Anders Carlsson  <andersca@apple.com>
1549
1550         Fix tyop.
1551
1552         * Shared/mac/CoreAnimationRenderer.mm:
1553
1554 2011-01-28  Anders Carlsson  <andersca@apple.com>
1555
1556         Reviewed by Sam Weinig.
1557
1558         Add CoreAnimationRenderer class
1559         https://bugs.webkit.org/show_bug.cgi?id=53343
1560
1561         * Shared/mac/CoreAnimationRenderer.h: Added.
1562         * Shared/mac/CoreAnimationRenderer.mm: Added.
1563
1564         (WebKit::CoreAnimationRenderer::CoreAnimationRenderer):
1565         Initialize the underlying CARenderer object and hook up a notification observer.
1566
1567         (WebKit::CoreAnimationRenderer::~CoreAnimationRenderer):
1568         Assert that the client is null. It has been set to null by the call to invalidate().
1569
1570         (WebKit::CoreAnimationRenderer::setBounds):
1571         Update the bounds on the CARenderer and the root layer.
1572
1573         (WebKit::CoreAnimationRenderer::render):
1574         Ask the renderer to render and return the next frame time.
1575
1576         (WebKit::CoreAnimationRenderer::invalidate):
1577         Remove the change observer and reset the client.
1578
1579         (WebKit::CoreAnimationRenderer::rendererDidChange):
1580         Call the client member function.
1581
1582         * WebKit2.xcodeproj/project.pbxproj:
1583         Add new files.
1584
1585 2011-01-28  Anders Carlsson  <andersca@apple.com>
1586
1587         Reviewed by Sam Weinig.
1588
1589         Add an OBJC_CLASS macro for forward declaring an Objective-C class
1590         https://bugs.webkit.org/show_bug.cgi?id=53337
1591
1592         * Shared/NativeWebKeyboardEvent.h:
1593         * Shared/PrintInfo.h:
1594         * UIProcess/ChunkedUpdateDrawingAreaProxy.h:
1595         * UIProcess/LayerBackedDrawingAreaProxy.h:
1596         * UIProcess/WebInspectorProxy.h:
1597         * UIProcess/mac/WebContextMenuProxyMac.h:
1598         * UIProcess/mac/WebPopupMenuProxyMac.h:
1599         * WebProcess/Downloads/Download.h:
1600         * WebProcess/Plugins/PluginProxy.h:
1601         * WebProcess/WebPage/LayerBackedDrawingArea.h:
1602         * WebProcess/WebPage/WebPage.h:
1603         * config.h:
1604
1605 2011-01-28  Anders Carlsson  <andersca@apple.com>
1606
1607         Reviewed by Sam Weinig.
1608
1609         Don't put config.h in the message headers.
1610
1611         * Scripts/webkit2/messages.py:
1612         * Scripts/webkit2/messages_unittest.py:
1613
1614 2011-01-28  Anders Carlsson  <andersca@apple.com>
1615
1616         Fix build.
1617
1618         * Shared/mac/ShareableSurface.cpp:
1619
1620 2011-01-28  Anders Carlsson  <andersca@apple.com>
1621
1622         Try to unbreak the Windows build.
1623
1624         * UIProcess/cf/WebPageProxyCF.cpp:
1625
1626 2011-01-28  Brady Eidson  <beidson@apple.com>
1627
1628         Reviewed by John Sullivan.
1629
1630         https://bugs.webkit.org/show_bug.cgi?id=53330
1631         Need InjectedBundle API to get the response MIMEType for a URL
1632
1633         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1634         (WKBundleFrameCopyMIMETypeForResourceWithURL):
1635         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
1636
1637         Get the MIMEType from the in-memory cache, or cachedResponseMIMETypeForURL() if not available:
1638         * WebProcess/WebPage/WebFrame.cpp:
1639         (WebKit::WebFrame::mimeTypeForResourceWithURL):
1640         * WebProcess/WebPage/WebFrame.h:
1641
1642         Get the MIMEType from the platform's disk cache if available:
1643         * WebProcess/WebPage/WebPage.h:
1644         * WebProcess/WebPage/mac/WebPageMac.mm:
1645         (WebKit::WebPage::cachedResponseMIMETypeForURL):
1646         * WebProcess/WebPage/qt/WebPageQt.cpp:
1647         (WebKit::WebPage::cachedResponseMIMETypeForURL):
1648         * WebProcess/WebPage/win/WebPageWin.cpp:
1649         (WebKit::WebPage::cachedResponseMIMETypeForURL):
1650
1651 2011-01-28  Anders Carlsson  <andersca@apple.com>
1652
1653         Reviewed by Sam Weinig.
1654
1655         Clean up the mess introduced when config.h was added to the project:
1656
1657         - Remove the contents of WebKit2Prefix.h that is now in config.h, to avoid including everything
1658           twice in each file, probably slowing down compile time.
1659
1660         - Add config.h to all the files that were forgotten in order to keep the build from breaking.
1661
1662         - Added trap to ensure that config.h is included at the top of every implementation file. If this
1663           had been added it would have caught the previous issue.
1664
1665 2011-01-28  Stephanie Lewis  <slewis@apple.com>
1666
1667         Reviewed by Geoff Garen.
1668
1669         <rdar://problem/8857651> Implement unregisterWorld for WebKit2
1670         Rename unregisterWorld to clearWrappers.  Clearing the wrappers reduces the 
1671         memory use of isolated worlds.
1672
1673         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
1674         (WKBundleScriptWorldClearWrappers):
1675         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
1676         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
1677         (WebKit::InjectedBundleScriptWorld::clearWrappers):
1678         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
1679
1680 2011-01-28  Dan Bernstein  <mitz@apple.com>
1681
1682         Reviewed by Sam Weinig.
1683
1684         <select> can't display right-to-left (rtl) languages
1685         https://bugs.webkit.org/show_bug.cgi?id=19785
1686
1687         * Shared/WebPopupItem.cpp:
1688         (WebKit::WebPopupItem::WebPopupItem): Added initializers for m_textDirection and m_hasTextDirectionOverride.
1689         (WebKit::WebPopupItem::encode): Encode the item's writing direction and direction override values.
1690         (WebKit::WebPopupItem::decode): Decode the item's writing direction and direction override values.
1691         * Shared/WebPopupItem.h:
1692         * UIProcess/WebPageProxy.cpp:
1693         (WebKit::WebPageProxy::showPopupMenu): Added a parameter for the menu's text direction.
1694         * UIProcess/WebPageProxy.h:
1695         * UIProcess/WebPageProxy.messages.in: Ditto.
1696         * UIProcess/WebPopupMenuProxy.h:
1697         * UIProcess/mac/WebPopupMenuProxyMac.h:
1698         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1699         (WebKit::WebPopupMenuProxyMac::populate): Added a parameter for the menu's text direction.
1700         Set items' text alignment to match the menu's writing direction. Set items' writing direction
1701         and direction override according to their styles.
1702         (WebKit::WebPopupMenuProxyMac::showPopupMenu): Set the pop-up's layout direction.
1703         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1704         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural): Changed to return false.
1705         (WebKit::WebChromeClient::selectItemAlignmentFollowsMenuWritingDirection): Added.
1706         * WebProcess/WebCoreSupport/WebChromeClient.h:
1707         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
1708         (WebKit::WebPopupMenu::populateItems): Initialize items' writing direction and direction override
1709         values.
1710         (WebKit::WebPopupMenu::show): Pass the menu's writing direction.
1711
1712 2011-01-28  Anders Carlsson  <andersca@apple.com>
1713
1714         Reviewed by Adam Roben.
1715
1716         Add ShareableSurface class
1717         https://bugs.webkit.org/show_bug.cgi?id=53313
1718
1719         * Shared/mac/ShareableSurface.cpp: Added.
1720         (WebKit::ShareableSurface::Handle::Handle):
1721         Initialize the mach port.
1722
1723         (WebKit::ShareableSurface::Handle::~Handle):
1724         Deallocate our send right if needed.
1725
1726         (WebKit::ShareableSurface::Handle::encode):
1727         Encode the send right, and then null it out.
1728
1729         (WebKit::ShareableSurface::Handle::decode):
1730         Decode the send right.
1731         
1732         (WebKit::createIOSurface):
1733         Create an IOSurface with the given size.
1734
1735         (WebKit::ShareableSurface::create):
1736         Create an IOSurface, either from a size or from a handle.
1737
1738         (WebKit::ShareableSurface::~ShareableSurface):
1739         Delete the texture and framebuffer.
1740
1741         (WebKit::ShareableSurface::createHandle):
1742         Create a mach port from the surface.
1743
1744         (WebKit::ShareableSurface::attach):
1745         Create an FBO if needed and bind it.
1746
1747         (WebKit::ShareableSurface::detach):
1748         Unbind the FBO.
1749
1750         (WebKit::ShareableSurface::textureID):
1751         Generate a new texture and bind it to the IOSurface.
1752
1753         * Shared/mac/ShareableSurface.h: Added.
1754
1755         * WebKit2.xcodeproj/project.pbxproj:
1756         Add new files.
1757
1758 2011-01-27  Adam Roben  <aroben@apple.com>
1759
1760         Change BinarySemaphore to wrap an auto-reset Win32 event on Windows
1761
1762         Fixes <http://webkit.org/b/53208> <rdar://problem/8922490>.
1763
1764         Reviewed by Dave Hyatt.
1765
1766         * Platform/CoreIPC/BinarySemaphore.cpp: Wrap this implementation in #if !PLATFORM(WIN).
1767
1768         * Platform/CoreIPC/BinarySemaphore.h: Make the Windows implementation have a single HANDLE
1769         member that holds the event.
1770
1771         * Platform/CoreIPC/win/BinarySemaphoreWin.cpp: Copied from Source/WebKit2/Platform/CoreIPC/BinarySemaphore.cpp.
1772         (CoreIPC::BinarySemaphore::BinarySemaphore): Create our event.
1773         (CoreIPC::BinarySemaphore::~BinarySemaphore): Destory our event.
1774         (CoreIPC::BinarySemaphore::signal): Signal the event.
1775         (CoreIPC::BinarySemaphore::wait): Convert the absolute time to a wait interval, then wait
1776         for the event to be signaled or for the interval to elapse.
1777
1778         * win/WebKit2.vcproj: Added BinarySemaphoreWin.cpp. Also let VS have its way with the file.
1779
1780 2011-01-27  Chris Marrin  <cmarrin@apple.com>
1781
1782         Reviewed by Anders Carlsson.
1783
1784         WebKit2: Page flashes just before accelerated compositing animation
1785         https://bugs.webkit.org/show_bug.cgi?id=53274
1786
1787         When switching out of compositing mode, the new ChunkedUpdateDrawingAreaProxy
1788         is getting created with the current page size. When the setSize() call is
1789         subsequently made, the sizeDidChange() call is not made (which does the initial
1790         render of the page) because the old size and new size are the same. The solution
1791         is to skip the setting of the size in the ctor and let it go through a size
1792         change sequence.
1793
1794         * UIProcess/DrawingAreaProxy.cpp:
1795         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
1796
1797 2011-01-28  Alejandro G. Castro  <alex@igalia.com>
1798
1799         Reviewed by Xan Lopez.
1800
1801         [GTK] Fix dist compilation for the release
1802         https://bugs.webkit.org/show_bug.cgi?id=53290
1803
1804         * GNUmakefile.am: Remove a file that is not in the repository
1805         anymore.
1806
1807
1808 2011-01-28  Andreas Kling  <kling@webkit.org>
1809
1810         Rubber-stamped by Simon Hausmann.
1811
1812         [Qt][WK2] Combine QWKPage::engine{Connected,Disconnected} into one signal.
1813
1814         Having two signals for this is redundant, combine them into
1815         QWKPage::engineConnectionChanged(bool connected).
1816
1817         * UIProcess/API/qt/qwkpage.cpp:
1818         (QWKPagePrivate::didRelaunchProcess):
1819         (QWKPagePrivate::processDidCrash):
1820         * UIProcess/API/qt/qwkpage.h:
1821
1822 2011-01-27  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1823
1824         Reviewed by Maciej Stachowiak.
1825
1826         Build fix for Mac Intel Debug after r76916
1827         https://bugs.webkit.org/show_bug.cgi?id=53284
1828
1829         Fix macro redefinition by guarding the redefined macros.
1830
1831         * config.h:
1832
1833 2011-01-27  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1834
1835         Unreviewed build fix for Mac Intel Debug after r76916.
1836
1837         Fix macro redefinition by guarding the redefined macros.
1838
1839         Check if the macro is already defined before defininig it.
1840         c++config.h has the same macros with the same values.
1841
1842         * config.h:
1843
1844 2011-01-27  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1845
1846         Reviewed by Adam Barth.
1847
1848         Update the expected results for test-webkitpy after r76916.
1849
1850         Include "config.h" in the expected results as well.
1851
1852         * Scripts/webkit2/messages_unittest.py:
1853
1854 2011-01-27  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1855
1856         Unreviewed buildfix for SnowLeopard Intel Debug.
1857
1858         Fix macro redefinition by not including config.h.
1859
1860         Revert previous change in WebPageProxyCF.cpp.
1861
1862         * UIProcess/cf/WebPageProxyCF.cpp:
1863
1864 2011-01-27  Greg Coletta  <greg.coletta@nokia.com>
1865
1866         Reviewed by Laszlo Gombos.
1867
1868         Get rid of prefix header dependency for WebKit2 build system.
1869         https://bugs.webkit.org/show_bug.cgi?id=50174
1870
1871         Add config.h include explicitelly.
1872
1873         * Platform/CoreIPC/ArgumentDecoder.cpp:
1874         * Platform/CoreIPC/ArgumentEncoder.cpp:
1875         * Platform/CoreIPC/Attachment.cpp:
1876         * Platform/CoreIPC/BinarySemaphore.cpp:
1877         * Platform/CoreIPC/Connection.cpp:
1878         * Platform/CoreIPC/DataReference.cpp:
1879         * Platform/CoreIPC/gtk/ConnectionGtk.cpp:
1880         * Platform/CoreIPC/mac/ConnectionMac.cpp:
1881         * Platform/CoreIPC/qt/ConnectionQt.cpp:
1882         * Platform/CoreIPC/win/ConnectionWin.cpp:
1883         * Platform/Logging.cpp:
1884         * Platform/Module.cpp:
1885         * Platform/Region.cpp:
1886         * Platform/RunLoop.cpp:
1887         * Platform/WorkQueue.cpp:
1888         * Platform/cg/CGUtilities.cpp:
1889         * Platform/gtk/RunLoopGtk.cpp:
1890         * Platform/gtk/SharedMemoryGtk.cpp:
1891         * Platform/gtk/WorkQueueGtk.cpp:
1892         * Platform/mac/MachUtilities.cpp:
1893         * Platform/mac/SharedMemoryMac.cpp:
1894         * Platform/mac/WorkQueueMac.cpp:
1895         * Platform/qt/MappedMemoryPool.cpp:
1896         * Platform/qt/ModuleQt.cpp:
1897         * Platform/qt/RunLoopQt.cpp:
1898         * Platform/qt/WorkQueueQt.cpp:
1899         * Platform/win/ModuleWin.cpp:
1900         * Platform/win/RunLoopWin.cpp:
1901         * Platform/win/SharedMemoryWin.cpp:
1902         * Platform/win/WorkQueueWin.cpp:
1903         * PluginProcess/PluginControllerProxy.cpp:
1904         * PluginProcess/PluginProcess.cpp:
1905         * PluginProcess/WebProcessConnection.cpp:
1906         * Scripts/webkit2/messages.py:
1907         * Shared/API/c/WKArray.cpp:
1908         * Shared/API/c/WKCertificateInfo.cpp:
1909         * Shared/API/c/WKContextMenuItem.cpp:
1910         * Shared/API/c/WKData.cpp:
1911         * Shared/API/c/WKDictionary.cpp:
1912         * Shared/API/c/WKError.cpp:
1913         * Shared/API/c/WKImage.cpp:
1914         * Shared/API/c/WKMutableArray.cpp:
1915         * Shared/API/c/WKMutableDictionary.cpp:
1916         * Shared/API/c/WKNumber.cpp:
1917         * Shared/API/c/WKSecurityOrigin.cpp:
1918         * Shared/API/c/WKSerializedScriptValue.cpp:
1919         * Shared/API/c/WKString.cpp:
1920         * Shared/API/c/WKType.cpp:
1921         * Shared/API/c/WKURL.cpp:
1922         * Shared/API/c/WKURLRequest.cpp:
1923         * Shared/API/c/WKURLResponse.cpp:
1924         * Shared/API/c/WKUserContentURLPattern.cpp:
1925         * Shared/API/c/cf/WKStringCF.cpp:
1926         * Shared/API/c/cf/WKURLCF.cpp:
1927         * Shared/API/c/cf/WKURLRequestCF.cpp:
1928         * Shared/API/c/cf/WKURLResponseCF.cpp:
1929         * Shared/API/c/cg/WKImageCG.cpp:
1930         * Shared/API/c/win/WKCertificateInfoWin.cpp:
1931         * Shared/ChildProcess.cpp:
1932         * Shared/ImmutableArray.cpp:
1933         * Shared/ImmutableDictionary.cpp:
1934         * Shared/MutableArray.cpp:
1935         * Shared/MutableDictionary.cpp:
1936         * Shared/OriginAndDatabases.cpp:
1937         * Shared/PlatformPopupMenuData.cpp:
1938         * Shared/Plugins/NPIdentifierData.cpp:
1939         * Shared/Plugins/NPObjectMessageReceiver.cpp:
1940         * Shared/Plugins/NPObjectProxy.cpp:
1941         * Shared/Plugins/NPRemoteObjectMap.cpp:
1942         * Shared/Plugins/NPVariantData.cpp:
1943         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1944         * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp:
1945         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
1946         * Shared/Plugins/PluginProcessCreationParameters.cpp:
1947         * Shared/PrintInfo.cpp:
1948         * Shared/SessionState.cpp:
1949         * Shared/ShareableBitmap.cpp:
1950         * Shared/UpdateInfo.cpp:
1951         * Shared/VisitedLinkTable.cpp:
1952         * Shared/WebBackForwardListItem.cpp:
1953         * Shared/WebContextMenuItem.cpp:
1954         * Shared/WebContextMenuItemData.cpp:
1955         * Shared/WebError.cpp:
1956         * Shared/WebEvent.cpp:
1957         * Shared/WebEventConversion.cpp:
1958         * Shared/WebGeolocationPosition.cpp:
1959         * Shared/WebImage.cpp:
1960         * Shared/WebKeyboardEvent.cpp:
1961         * Shared/WebMemorySampler.cpp:
1962         * Shared/WebMouseEvent.cpp:
1963         * Shared/WebOpenPanelParameters.cpp:
1964         * Shared/WebPageCreationParameters.cpp:
1965         * Shared/WebPageGroupData.cpp:
1966         * Shared/WebPlatformTouchPoint.cpp:
1967         * Shared/WebPopupItem.cpp:
1968         * Shared/WebPreferencesStore.cpp:
1969         * Shared/WebProcessCreationParameters.cpp:
1970         * Shared/WebTouchEvent.cpp:
1971         * Shared/WebURLRequest.cpp:
1972         * Shared/WebURLResponse.cpp:
1973         * Shared/WebWheelEvent.cpp:
1974         * Shared/cairo/ShareableBitmapCairo.cpp:
1975         * Shared/cf/ArgumentCodersCF.cpp:
1976         * Shared/cg/ShareableBitmapCG.cpp:
1977         * Shared/gtk/ShareableBitmapGtk.cpp:
1978         * Shared/gtk/WebCoreArgumentCodersGtk.cpp:
1979         * Shared/mac/CommandLineMac.cpp:
1980         * Shared/mac/UpdateChunk.cpp:
1981         * Shared/qt/CleanupHandler.cpp:
1982         * Shared/qt/NativeWebKeyboardEventQt.cpp:
1983         * Shared/qt/ShareableBitmapQt.cpp:
1984         * Shared/qt/UpdateChunk.cpp:
1985         * Shared/qt/WebCoreArgumentCodersQt.cpp:
1986         * Shared/qt/WebEventFactoryQt.cpp:
1987         * Shared/qt/WebURLRequestQt.cpp:
1988         * Shared/qt/WebURLResponseQt.cpp:
1989         * Shared/win/CommandLineWin.cpp:
1990         * Shared/win/NativeWebKeyboardEventWin.cpp:
1991         * Shared/win/PlatformCertificateInfo.cpp:
1992         * Shared/win/UpdateChunk.cpp:
1993         * Shared/win/WebCoreArgumentCodersWin.cpp:
1994         * Shared/win/WebEventFactory.cpp:
1995         * Shared/win/WebURLRequestWin.cpp:
1996         * Shared/win/WebURLResponseWin.cpp:
1997         * UIProcess/API/C/WKAuthenticationChallenge.cpp:
1998         * UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
1999         * UIProcess/API/C/WKBackForwardList.cpp:
2000         * UIProcess/API/C/WKBackForwardListItem.cpp:
2001         * UIProcess/API/C/WKContext.cpp:
2002         * UIProcess/API/C/WKCredential.cpp:
2003         * UIProcess/API/C/WKDatabaseManager.cpp:
2004         * UIProcess/API/C/WKDownload.cpp:
2005         * UIProcess/API/C/WKFormSubmissionListener.cpp:
2006         * UIProcess/API/C/WKFrame.cpp:
2007         * UIProcess/API/C/WKFramePolicyListener.cpp:
2008         * UIProcess/API/C/WKGeolocationManager.cpp:
2009         * UIProcess/API/C/WKGeolocationPermissionRequest.cpp:
2010         * UIProcess/API/C/WKGeolocationPosition.cpp:
2011         * UIProcess/API/C/WKInspector.cpp:
2012         * UIProcess/API/C/WKNavigationData.cpp:
2013         * UIProcess/API/C/WKOpenPanelParameters.cpp:
2014         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
2015         * UIProcess/API/C/WKPage.cpp:
2016         * UIProcess/API/C/WKPageGroup.cpp:
2017         * UIProcess/API/C/WKPreferences.cpp:
2018         * UIProcess/API/C/WKProtectionSpace.cpp:
2019         * UIProcess/API/C/win/WKContextWin.cpp:
2020         * UIProcess/API/C/win/WKView.cpp:
2021         * UIProcess/API/C/win/WKViewPrivate.cpp:
2022         * UIProcess/API/cpp/qt/WKStringQt.cpp:
2023         * UIProcess/API/cpp/qt/WKURLQt.cpp:
2024         * UIProcess/API/qt/ClientImpl.cpp:
2025         * UIProcess/API/qt/qgraphicswkview.cpp:
2026         * UIProcess/API/qt/qwkcontext.cpp:
2027         * UIProcess/API/qt/qwkpage.cpp:
2028         * UIProcess/API/qt/qwkpreferences.cpp:
2029         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
2030         * UIProcess/Authentication/AuthenticationDecisionListener.cpp:
2031         * UIProcess/Authentication/WebCredential.cpp:
2032         * UIProcess/Authentication/WebProtectionSpace.cpp:
2033         * UIProcess/BackingStore.cpp:
2034         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
2035         * UIProcess/Downloads/DownloadProxy.cpp:
2036         * UIProcess/DrawingAreaProxy.cpp:
2037         * UIProcess/DrawingAreaProxyImpl.cpp:
2038         * UIProcess/FindIndicator.cpp:
2039         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
2040         * UIProcess/GeolocationPermissionRequestProxy.cpp:
2041         * UIProcess/Launcher/ProcessLauncher.cpp:
2042         * UIProcess/Launcher/ThreadLauncher.cpp:
2043         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2044         * UIProcess/Launcher/gtk/ThreadLauncherGtk.cpp:
2045         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
2046         * UIProcess/Launcher/qt/ThreadLauncherQt.cpp:
2047         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
2048         * UIProcess/Launcher/win/ThreadLauncherWin.cpp:
2049         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
2050         * UIProcess/Plugins/PluginInfoStore.cpp:
2051         * UIProcess/Plugins/PluginProcessManager.cpp:
2052         * UIProcess/Plugins/PluginProcessProxy.cpp:
2053         * UIProcess/Plugins/gtk/PluginInfoStoreGtk.cpp:
2054         * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp:
2055         * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
2056         * UIProcess/ResponsivenessTimer.cpp:
2057         * UIProcess/TiledDrawingAreaProxy.cpp:
2058         * UIProcess/VisitedLinkProvider.cpp:
2059         * UIProcess/WebBackForwardList.cpp:
2060         * UIProcess/WebContext.cpp:
2061         * UIProcess/WebContextInjectedBundleClient.cpp:
2062         * UIProcess/WebContextMenuProxy.cpp:
2063         * UIProcess/WebDatabaseManagerProxy.cpp:
2064         * UIProcess/WebDatabaseManagerProxyClient.cpp:
2065         * UIProcess/WebDownloadClient.cpp:
2066         * UIProcess/WebEditCommandProxy.cpp:
2067         * UIProcess/WebFindClient.cpp:
2068         * UIProcess/WebFormClient.cpp:
2069         * UIProcess/WebFormSubmissionListenerProxy.cpp:
2070         * UIProcess/WebFrameListenerProxy.cpp:
2071         * UIProcess/WebFramePolicyListenerProxy.cpp:
2072         * UIProcess/WebFrameProxy.cpp:
2073         * UIProcess/WebGeolocationManagerProxy.cpp:
2074         * UIProcess/WebGeolocationProvider.cpp:
2075         * UIProcess/WebHistoryClient.cpp:
2076         * UIProcess/WebInspectorProxy.cpp:
2077         * UIProcess/WebLoaderClient.cpp:
2078         * UIProcess/WebNavigationData.cpp:
2079         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
2080         * UIProcess/WebPageContextMenuClient.cpp:
2081         * UIProcess/WebPageGroup.cpp:
2082         * UIProcess/WebPageProxy.cpp:
2083         * UIProcess/WebPolicyClient.cpp:
2084         * UIProcess/WebPreferences.cpp:
2085         * UIProcess/WebProcessManager.cpp:
2086         * UIProcess/WebProcessProxy.cpp:
2087         * UIProcess/WebResourceLoadClient.cpp:
2088         * UIProcess/WebUIClient.cpp:
2089         * UIProcess/cf/WebBackForwardListCF.cpp:
2090         * UIProcess/cf/WebPageProxyCF.cpp:
2091         * UIProcess/cf/WebPreferencesCF.cpp:
2092         * UIProcess/gtk/TextCheckerGtk.cpp:
2093         * UIProcess/gtk/WebInspectorGtk.cpp:
2094         * UIProcess/gtk/WebPageProxyGtk.cpp:
2095         * UIProcess/gtk/WebPreferencesGtk.cpp:
2096         * UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp:
2097         * UIProcess/qt/TextCheckerQt.cpp:
2098         * UIProcess/qt/TiledDrawingAreaProxyQt.cpp:
2099         * UIProcess/qt/TiledDrawingAreaTileQt.cpp:
2100         * UIProcess/qt/WebContextMenuProxyQt.cpp:
2101         * UIProcess/qt/WebContextQt.cpp:
2102         * UIProcess/qt/WebInspectorProxyQt.cpp:
2103         * UIProcess/qt/WebPageProxyQt.cpp:
2104         * UIProcess/qt/WebPopupMenuProxyQt.cpp:
2105         * UIProcess/qt/WebPreferencesQt.cpp:
2106         * UIProcess/win/ChunkedUpdateDrawingAreaProxyWin.cpp:
2107         * UIProcess/win/LayerBackedDrawingAreaProxyWin.cpp:
2108         * UIProcess/win/TextCheckerWin.cpp:
2109         * UIProcess/win/WebContextMenuProxyWin.cpp:
2110         * UIProcess/win/WebContextWin.cpp:
2111         * UIProcess/win/WebInspectorProxyWin.cpp:
2112         * UIProcess/win/WebPageProxyWin.cpp:
2113         * UIProcess/win/WebPopupMenuProxyWin.cpp:
2114         * UIProcess/win/WebView.cpp:
2115         * WebKit2.xcodeproj/project.pbxproj:
2116         * WebProcess/Authentication/AuthenticationManager.cpp:
2117         * WebProcess/Downloads/Download.cpp:
2118         * WebProcess/Downloads/DownloadManager.cpp:
2119         * WebProcess/Downloads/cf/DownloadCFNet.cpp:
2120         * WebProcess/Downloads/curl/DownloadCurl.cpp:
2121         * WebProcess/Downloads/qt/DownloadQt.cpp:
2122         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
2123         * WebProcess/Geolocation/WebGeolocationManager.cpp:
2124         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2125         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp:
2126         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
2127         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2128         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
2129         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
2130         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2131         * WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp:
2132         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2133         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
2134         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
2135         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2136         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2137         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2138         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
2139         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
2140         * WebProcess/InjectedBundle/InjectedBundleClient.cpp:
2141         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
2142         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
2143         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
2144         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
2145         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2146         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2147         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
2148         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
2149         * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
2150         * WebProcess/InjectedBundle/qt/InjectedBundleQt.cpp:
2151         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
2152         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2153         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2154         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2155         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2156         * WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp:
2157         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2158         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2159         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
2160         * WebProcess/Plugins/Netscape/gtk/NetscapePluginGtk.cpp:
2161         * WebProcess/Plugins/Netscape/qt/NetscapePluginQt.cpp:
2162         * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
2163         * WebProcess/Plugins/Plugin.cpp:
2164         * WebProcess/Plugins/PluginProcessConnection.cpp:
2165         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2166         * WebProcess/Plugins/PluginProxy.cpp:
2167         * WebProcess/Plugins/PluginView.cpp:
2168         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2169         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2170         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
2171         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2172         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2173         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2174         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
2175         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2176         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
2177         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2178         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
2179         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
2180         * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
2181         * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
2182         * WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp:
2183         * WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp:
2184         * WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp:
2185         * WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp:
2186         * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp:
2187         * WebProcess/WebCoreSupport/win/WebErrorsWin.cpp:
2188         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
2189         * WebProcess/WebKitMain.cpp:
2190         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
2191         * WebProcess/WebPage/DecoderAdapter.cpp:
2192         * WebProcess/WebPage/DrawingArea.cpp:
2193         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2194         * WebProcess/WebPage/EncoderAdapter.cpp:
2195         * WebProcess/WebPage/FindController.cpp:
2196         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
2197         * WebProcess/WebPage/PageOverlay.cpp:
2198         * WebProcess/WebPage/TiledDrawingArea.cpp:
2199         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2200         * WebProcess/WebPage/WebContextMenu.cpp:
2201         * WebProcess/WebPage/WebEditCommand.cpp:
2202         * WebProcess/WebPage/WebFrame.cpp:
2203         * WebProcess/WebPage/WebInspector.cpp:
2204         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
2205         * WebProcess/WebPage/WebPage.cpp:
2206         * WebProcess/WebPage/WebPageGroupProxy.cpp:
2207         * WebProcess/WebPage/gtk/WebInspectorGtk.cpp:
2208         * WebProcess/WebPage/mac/ChunkedUpdateDrawingAreaMac.cpp:
2209         * WebProcess/WebPage/qt/ChunkedUpdateDrawingAreaQt.cpp:
2210         * WebProcess/WebPage/qt/TiledDrawingAreaQt.cpp:
2211         * WebProcess/WebPage/qt/WebInspectorQt.cpp:
2212         * WebProcess/WebPage/qt/WebPageQt.cpp:
2213         * WebProcess/WebPage/win/ChunkedUpdateDrawingAreaWin.cpp:
2214         * WebProcess/WebPage/win/LayerBackedDrawingAreaWin.cpp:
2215         * WebProcess/WebPage/win/WebInspectorWin.cpp:
2216         * WebProcess/WebPage/win/WebPageWin.cpp:
2217         * WebProcess/WebProcess.cpp:
2218         * WebProcess/gtk/WebProcessGtk.cpp:
2219         * WebProcess/gtk/WebProcessMainGtk.cpp:
2220         * WebProcess/qt/WebProcessMainQt.cpp:
2221         * WebProcess/qt/WebProcessQt.cpp:
2222         * WebProcess/win/WebProcessMainWin.cpp:
2223         * WebProcess/win/WebProcessWin.cpp:
2224         * config.h: Copied from Source/WebKit2/WebKit2Prefix.h.
2225         * win/WebKit2Common.vsprops:
2226
2227 2011-01-27  Maciej Stachowiak  <mjs@apple.com>
2228
2229         Reviewed by Darin Adler.
2230
2231         execCommand("Paste") doesn't work in WebKitTestRunner
2232         https://bugs.webkit.org/show_bug.cgi?id=52785
2233         
2234         Thread through the new JavaScriptCanAccessClipboard setting.
2235
2236         * Shared/WebPreferencesStore.h:
2237         * UIProcess/API/C/WKPreferences.cpp:
2238         (WKPreferencesSetJavaScriptCanAccessClipboard):
2239         (WKPreferencesGetJavaScriptCanAccessClipboard):
2240         * UIProcess/API/C/WKPreferences.h:
2241         * WebProcess/WebPage/WebPage.cpp:
2242         (WebKit::WebPage::updatePreferences):
2243
2244 2011-01-27  Nate Chapin  <japhet@chromium.org>
2245
2246         Reviewed by Adam Barth.
2247
2248         Use Document::url() instead of FrameLoader::url().
2249         https://bugs.webkit.org/show_bug.cgi?id=41165
2250
2251         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2252         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
2253         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
2254         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
2255         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
2256         * WebProcess/WebPage/WebFrame.cpp:
2257         (WebKit::WebFrame::url):
2258
2259 2011-01-27  Sam Weinig  <sam@webkit.org>
2260
2261         Reviewed by Anders Carlsson.
2262
2263         Encode/Decode hasPreciseScrollingDeltas bit in WebWheelEvent
2264         https://bugs.webkit.org/show_bug.cgi?id=53254
2265
2266         * Shared/WebWheelEvent.cpp:
2267         (WebKit::WebWheelEvent::WebWheelEvent):
2268         Initialize m_phase and m_hasPreciseScrollingDeltas.
2269
2270         (WebKit::WebWheelEvent::encode):
2271         (WebKit::WebWheelEvent::decode):
2272         Add missing coding for m_hasPreciseScrollingDeltas.
2273
2274 2011-01-26  Enrica Casucci  <enrica@apple.com>
2275
2276         Reviewed by Darin Adler and Adam Roben.
2277
2278         WebKit2: add support for drag and drop on Windows
2279         https://bugs.webkit.org/show_bug.cgi?id=52775
2280         <rdar://problem/8514409>
2281
2282         On Windows the access to the content being dragged is
2283         provided via the IDataObject interface that is made available
2284         to the window that registers itself as drop target.
2285         Since this interface cannot be accessed from the WebProcess,
2286         in every call to one of the methods of the IDropTarget interface
2287         we serialize the content of the drag clipboard and send it over to
2288         the WebProcess. The implementation uses the same messages as the
2289         Mac one, with slightly different parameters to pass the serialized
2290         clipboard.
2291
2292         * UIProcess/WebPageProxy.cpp:
2293         (WebKit::WebPageProxy::performDragControllerAction): Added Windows
2294         specific implementation.
2295         * UIProcess/WebPageProxy.h:
2296         * UIProcess/win/WebView.cpp:
2297         (WebKit::WebView::WebView): Added dropTargetHelper object creation.
2298         (WebKit::WebView::initialize): Added to register for drag/drop with out
2299         refcount issues.
2300         (WebKit::WebView::close):
2301         (WebKit::WebView::windowReceivedMessage):
2302         (WebKit::WebView::QueryInterface):
2303         (WebKit::WebView::AddRef):
2304         (WebKit::WebView::Release):
2305         (WebKit::dragOperationToDragCursor):
2306         (WebKit::WebView::keyStateToDragOperation):
2307         (WebKit::WebView::DragEnter):
2308         (WebKit::WebView::DragOver):
2309         (WebKit::WebView::DragLeave):
2310         (WebKit::WebView::Drop):
2311         * UIProcess/win/WebView.h:
2312         (WebKit::WebView::create):
2313         * WebProcess/WebPage/WebPage.cpp:
2314         (WebKit::WebPage::performDragControllerAction):
2315         * WebProcess/WebPage/WebPage.h:
2316         * WebProcess/WebPage/WebPage.messages.in:
2317
2318 2011-01-26  Alexey Proskuryakov  <ap@apple.com>
2319
2320         Reviewed by Darin Adler.
2321
2322         https://bugs.webkit.org/show_bug.cgi?id=53197
2323         <rdar://problem/8895682> Make WebKit2 printing asynchronous
2324
2325         <rdar://problem/8899988> REGRESSION(WebKit2): Attempting to print WHATWG HTML spec shows
2326         1-page blank preview
2327
2328         <rdar://problem/8900078> WebKit2 printing has a separate message exchange per page when
2329         printing instead of printing all at once
2330
2331         * UIProcess/API/mac/WKPrintingView.h: Store a lot more cached information.
2332
2333         * UIProcess/API/mac/WKPrintingView.mm:
2334         (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]): Use PrintOperation stored in
2335         class. We generally want that now, because current operation will not be set up on other threads.
2336         (-[WKPrintingView _isPrintingPreview]): Added. Preview is different, because it can draw
2337         a placeholder - but actual printing need to wait until UI process has data.
2338         (-[WKPrintingView _updatePreview]): Force AppKit to update print preview when we have real
2339         data to replace placeholder with.
2340         (-[WKPrintingView _hasPageRects]): Return if page rects have already been computed.
2341         (-[WKPrintingView _expectedPreviewCallbackForRect:]): Find an existing request for this rect,
2342         if any.
2343         (pageDidDrawToPDF): Update preview - or if actually printing, release control to printing thread.
2344         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ask for a PDF document with
2345         pages the user asked to print.
2346         (pageDidComputePageRects): When web process returns page geometry data, we update preview to display
2347         a page count (which indirectly triggers a request for a preview). When actually printing,
2348         request a PDF right away, we'll need it later.
2349         (-[WKPrintingView _askPageToComputePageRects]): Ask web process for page geometry.
2350         (prepareDataForPrintingOnSecondaryThread): This function starts preparing all data necessary
2351         for actual printing on main thread.
2352         (-[WKPrintingView knowsPageRange:]): Changed to be async for preview, and to call main
2353         thread for actual printing.
2354         (-[WKPrintingView _pageForRect:]): Find page number for a given range, assuming that AppKit
2355         always asks for full pages.
2356         (-[WKPrintingView _drawPDFDocument:page:atPoint:]): A helper function to draw a PDF document.
2357         (-[WKPrintingView _drawPreview:]): Draw the whole page for preview.
2358         (-[WKPrintingView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
2359         Draw the whole page for actual printing.
2360         (-[WKPrintingView _drawPageBorderWithSizeOnMainThread:]): Call drawPageBorderWithSize: with
2361         correct graphics context and print operation.
2362         (-[WKPrintingView drawPageBorderWithSize:]): Delegate work to main thread when called from a
2363         secondary one.
2364         (-[WKPrintingView _provideTotalScaleFactorForPrintOperation:]): Added an assertion that
2365         our stored NSPrintOperation isn't out of sync with reality.
2366         (-[WKPrintingView rectForPage:]): Handle the case where we don't have the data yet, drawing
2367         a placeholder.
2368         (-[WKPrintingView endDocument]): When page setup changes, we must reset all state.
2369
2370         * UIProcess/API/mac/WKView.mm: (-[WKView printOperationWithPrintInfo:forFrame:]): Tell
2371         NSPrintingView which operation it's serving, so that it knows it even when current operation
2372         isn't set.
2373
2374         * UIProcess/GenericCallback.h:
2375         (WebKit::ComputedPagesCallback::create):
2376         (WebKit::ComputedPagesCallback::~ComputedPagesCallback):
2377         (WebKit::ComputedPagesCallback::performCallbackWithReturnValue):
2378         (WebKit::ComputedPagesCallback::invalidate):
2379         (WebKit::ComputedPagesCallback::callbackID):
2380         (WebKit::ComputedPagesCallback::generateCallbackID):
2381         (WebKit::ComputedPagesCallback::ComputedPagesCallback):
2382         Added ComputedPagesCallback, which returns a vector of IntRects and a double. Hopefully,
2383         it will become a specialization of GenericCallback one day.
2384
2385         * UIProcess/WebPageProxy.cpp:
2386         (WebKit::WebPageProxy::close): Added m_voidCallbacks - it looks like they were omitted
2387         by accident.
2388         (WebKit::WebPageProxy::computedPagesCallback): Added.
2389         (WebKit::WebPageProxy::processDidCrash): Added m_computedPagesCallbacks.
2390         (WebKit::WebPageProxy::computePagesForPrinting): Async now!
2391         (WebKit::WebPageProxy::drawRectToPDF): Ditto.
2392         (WebKit::WebPageProxy::drawPagesToPDF): Added.
2393         * UIProcess/WebPageProxy.h:
2394
2395         * UIProcess/WebPageProxy.messages.in: Added ComputedPagesCallback.
2396
2397         * WebProcess/WebPage/WebPage.cpp:
2398         (WebKit::WebPage::beginPriting): Compute page rects right away - we'll need them in
2399         drawPagesToPDF(), which doesn't have a PrintInfo.
2400         (WebKit::WebPage::computePagesForPrinting): Send async response.
2401         (WebKit::WebPage::drawRectToPDF): This function used to draw into original
2402         location at frame coordinates, and now it draws at (0, 0).
2403         (WebKit::WebPage::drawPagesToPDF): Added - make a multi-page PDF.
2404         * WebProcess/WebPage/WebPage.h:
2405
2406         * WebProcess/WebPage/WebPage.messages.in: Added DrawPagesToPDF.
2407
2408 2011-01-27  Alejandro G. Castro  <alex@igalia.com>
2409
2410         Unreviewed GTK build fix after r76797.
2411
2412         * Shared/WebPreferencesStore.h: Use Qt fonts preference for the moment.
2413
2414 2011-01-27  Dan Bernstein  <mitz@apple.com>
2415
2416         Reviewed by Anders Carlsson.
2417
2418         Allow pop-up menus to contain multiple items that have the same title.
2419
2420         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2421         (WebKit::WebPopupMenuProxyMac::populate): Set the item’s title after adding it rather than
2422         when adding it, so that it will not replace any existing item with the same title.
2423
2424 2011-01-27  Andreas Kling  <kling@webkit.org>
2425
2426         Reviewed by Kenneth Rohde Christiansen.
2427
2428         [Qt][WK2] Add QWKPage APIs regarding engine process availability
2429         https://bugs.webkit.org/show_bug.cgi?id=53237
2430
2431         QWKPage will now emit engineConnected() and engineDisconnected()
2432         when the web process crashes and is relaunched respectively.
2433
2434         Also added QWKPage::isConnectedToEngine() for convenience.
2435
2436         * UIProcess/API/qt/qwkpage.cpp:
2437         (QWKPagePrivate::QWKPagePrivate):
2438         (QWKPagePrivate::didRelaunchProcess):
2439         (QWKPagePrivate::processDidCrash):
2440         (QWKPage::isConnectedToEngine):
2441         * UIProcess/API/qt/qwkpage.h:
2442         * UIProcess/API/qt/qwkpage_p.h:
2443
2444 2011-01-27  Balazs Kelemen  <kbalazs@webkit.org>
2445
2446         Reviewed by Andreas Kling.
2447
2448         [Qt][WK2] Lots of layout test failures due to wrong font type
2449         https://bugs.webkit.org/show_bug.cgi?id=53233
2450
2451         * Shared/WebPreferencesStore.h:
2452         Specialize default font families for Qt.
2453
2454 2011-01-26  Maciej Stachowiak  <mjs@apple.com>
2455
2456         Reviewed by Dan Bernstein.
2457
2458         WebKitTestRunner needs to support layoutTestController.evaluateInWebInspector
2459         https://bugs.webkit.org/show_bug.cgi?id=42319
2460
2461         Add WKBundleInspector and APIs needed to implement WebKitTestRunner APIs.
2462         
2463         * GNUmakefile.am:
2464         * Shared/API/c/WKBase.h:
2465         * Shared/APIObject.h:
2466         * WebKit2.pro:
2467         * WebKit2.xcodeproj/project.pbxproj:
2468         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
2469         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp: Added.
2470         (WKBundleInspectorGetTypeID):
2471         (WKBundleInspectorShow):
2472         (WKBundleInspectorClose):
2473         (WKBundleInspectorEvaluateScriptForTest):
2474         (WKBundleInspectorSetPageProfilingEnabled):
2475         * WebProcess/InjectedBundle/API/c/WKBundleInspector.h: Added.
2476         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2477         (WKBundlePageGetInspector):
2478         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2479         * WebProcess/WebPage/WebInspector.cpp:
2480         (WebKit::WebInspector::create):
2481         (WebKit::WebInspector::evaluateScriptForTest):
2482         * WebProcess/WebPage/WebInspector.h:
2483         (WebKit::WebInspector::type):
2484         * WebProcess/WebPage/WebPage.cpp:
2485         (WebKit::WebPage::inspector):
2486         * WebProcess/WebPage/WebPage.h:
2487         * win/WebKit2.vcproj:
2488         * win/WebKit2Generated.make:
2489
2490 2011-01-26  David Kilzer  <ddkilzer@apple.com>
2491
2492         <http://webkit.org/b/53192> Add experimental support for HTTP pipelining in CFNetwork
2493         <rdar://problem/8821760>
2494
2495         Reviewed by Antti Koivisto.
2496
2497         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2498         (InitWebCoreSystemInterface): Added initialization for
2499         GetHTTPPipeliningPriority and SetHTTPPipeliningPriority.
2500
2501 2011-01-26  Beth Dakin  <bdakin@apple.com>
2502
2503         Reviewed by Darin Adler.
2504
2505         Fix for <rdar://problem/8895140> Adopt WKScrollbar metrics 
2506         when using WKScrollbars.
2507
2508         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2509         (InitWebCoreSystemInterface):
2510
2511 2011-01-26  Sam Weinig  <sam@webkit.org>
2512
2513         Reviewed by Maciej Stachowiak.
2514
2515         Add events to represent the start/end of a gesture scroll
2516         https://bugs.webkit.org/show_bug.cgi?id=53215
2517
2518         * Scripts/webkit2/messages.py:
2519         * Shared/WebEvent.h:
2520         (WebKit::WebGestureEvent::WebGestureEvent):
2521         (WebKit::WebGestureEvent::position):
2522         (WebKit::WebGestureEvent::globalPosition):
2523         * Shared/WebEventConversion.cpp:
2524         (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
2525         (WebKit::platform):
2526         * Shared/WebEventConversion.h:
2527         * Shared/WebGestureEvent.cpp: Added.
2528         (WebKit::WebGestureEvent::WebGestureEvent):
2529         (WebKit::WebGestureEvent::encode):
2530         (WebKit::WebGestureEvent::decode):
2531         (WebKit::WebGestureEvent::isGestureEventType):
2532         * Shared/mac/WebEventFactory.h:
2533         * Shared/mac/WebEventFactory.mm:
2534         (WebKit::gestureEventTypeForEvent):
2535         (WebKit::WebEventFactory::createWebGestureEvent):
2536         * UIProcess/API/mac/WKView.mm:
2537         (-[WKView shortCircuitedEndGestureWithEvent:]):
2538         (-[WKView beginGestureWithEvent:]):
2539         (-[WKView viewDidMoveToWindow]):
2540         * UIProcess/WebPageProxy.cpp:
2541         (WebKit::WebPageProxy::handleGestureEvent):
2542         (WebKit::WebPageProxy::didReceiveEvent):
2543         * UIProcess/WebPageProxy.h:
2544         * WebKit2.xcodeproj/project.pbxproj:
2545         * WebProcess/WebPage/WebPage.cpp:
2546         (WebKit::handleGestureEvent):
2547         (WebKit::WebPage::gestureEvent):
2548         * WebProcess/WebPage/WebPage.h:
2549         * WebProcess/WebPage/WebPage.messages.in:
2550         Pipe gesture events down to WebCore.
2551
2552 2011-01-26  Dan Bernstein  <mitz@apple.com>
2553
2554         Reviewed by Dave Hyatt.
2555
2556         <rdar://problem/8446709> Allow inter-ideograph justification for CJK
2557         https://bugs.webkit.org/show_bug.cgi?id=53184
2558
2559         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
2560         (WebKit::WebPopupMenu::setUpPlatformData): Added a TrailingExpansionBehavior parameter to the
2561         RenderText constructor.
2562
2563 2011-01-26  Jing Jin  <jjin@apple.com>
2564
2565         Reviewed by Darin Adler.
2566
2567         Methods to temporarily disable size updates to the page drawing area in WKView.
2568         https://bugs.webkit.org/show_bug.cgi?id=53206
2569         Part of <rdar://problem/8818585>
2570
2571         * UIProcess/API/mac/WKView.h: Added _frameSizeUpdateDisabledCount.
2572         * UIProcess/API/mac/WKView.mm:
2573         (-[WKView setFrameSize:]): Only update page size if frame size updates are enabled.
2574         (-[WKView _setDrawingAreaSize:]): Helper method to set the page's drawing area's size.
2575         (-[WKView disableFrameSizeUpdates]): Increment _frameSizeUpdateDisabledCount
2576         (-[WKView enableFrameSizeUpdates]): Decrement _frameSizeUpdateDisabledCount, and if the count is 0, meaning
2577         that no one is disabling frame size updates anymore, update the drawing area's size to match the current frame.
2578         (-[WKView frameSizeUpdatesDisabled]): Returns YES if at least one caller is disabling frame size updates.
2579         * UIProcess/API/mac/WKViewInternal.h: Declared -disableFrameSizeUpdates, -enableFrameSizeUpdates, and -frameSizeUpdatesDisabled.
2580         * UIProcess/API/mac/WKViewPrivate.h: Added.
2581         * WebKit2.xcodeproj/project.pbxproj: Added WKViewPrivate.h
2582
2583 2011-01-26  Jing Jin  <jjin@apple.com>
2584
2585         Rubber-stamped by Dan Bernstein.
2586         
2587         Several WKView Internal category methods are implemented in the main category.
2588         https://bugs.webkit.org/show_bug.cgi?id=53195
2589
2590         * UIProcess/API/mac/WKView.mm:
2591         (-[WKView _setEventBeingResent:]): Moved into implementation of WKView (Internal).
2592         (-[WKView _interceptKeyEvent:]): Moved into implementation of WKView (Internal).
2593         (-[WKView _getTextInputState:selectionEnd:underlines:WebCore::]): Moved into implementation of WKView (Internal).
2594         (-[WKView _setAccessibilityChildToken:]): Moved into implementation of WKView (Internal).
2595
2596 2011-01-26  Brian Weinstein  <bweinstein@apple.com>
2597
2598         Reviewed by John Sullivan.
2599
2600         WebKit2: Need API to get the frame load state of a BundleFrame
2601         https://bugs.webkit.org/show_bug.cgi?id=53193
2602
2603         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2604         (WKBundleFrameGetFrameLoadState): Call through to the FrameLoader to get the frame load state.
2605         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
2606
2607 2011-01-25  Brian Weinstein  <bweinstein@apple.com>
2608
2609         Reviewed by Antti Koivisto.
2610
2611         Crashes loading pages when cancelling subresource loads through WebKit
2612         https://bugs.webkit.org/show_bug.cgi?id=53123
2613         <rdar://problem/8914361>
2614
2615         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2616         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForMIMEType): If our URL is null, return early instead of dispatching
2617             a message.
2618
2619 2011-01-25  Chris Fleizach  <cfleizach@apple.com>
2620
2621         Reviewed by Darin Adler.
2622
2623         WK2 leaks when a page is closed
2624         https://bugs.webkit.org/show_bug.cgi?id=53100
2625
2626         Allow the WKView a chance to clean up on a page close. In this case,
2627         cleaning up means removing the references the accessibility token has
2628         to the window.
2629
2630         * UIProcess/API/mac/PageClientImpl.h:
2631         * UIProcess/API/mac/PageClientImpl.mm:
2632         (WebKit::PageClientImpl::pageClosed):
2633         * UIProcess/API/mac/WKView.mm:
2634         (-[WKView _setRemoteAccessibilityWindow:]):
2635         (-[WKView _setAccessibilityChildToken:]):
2636         (-[WKView _processDidCrash]):
2637         (-[WKView _pageClosed]):
2638         * UIProcess/API/mac/WKViewInternal.h:
2639         * UIProcess/API/qt/qwkpage_p.h:
2640         (QWKPagePrivate::pageClosed):
2641         * UIProcess/PageClient.h:
2642         * UIProcess/WebPageProxy.cpp:
2643         (WebKit::WebPageProxy::close):
2644         * UIProcess/win/WebView.cpp:
2645         (WebKit::WebView::pageClosed):
2646         * UIProcess/win/WebView.h:
2647
2648 2011-01-25  Chris Marrin  <cmarrin@apple.com>
2649
2650         Reviewed by Adam Roben.
2651
2652         Expose WebGL flag set/get in WK2
2653         https://bugs.webkit.org/show_bug.cgi?id=53096
2654
2655         * Shared/WebPreferencesStore.h:
2656         * UIProcess/API/C/WKPreferences.cpp:
2657         (WKPreferencesSetWebGLEnabled):
2658         (WKPreferencesGetWebGLEnabled):
2659         * UIProcess/API/C/WKPreferencesPrivate.h:
2660         * WebProcess/WebPage/WebPage.cpp:
2661         (WebKit::WebPage::updatePreferences):
2662
2663 2011-01-25  Anders Carlsson  <andersca@apple.com>
2664
2665         Reviewed by Adam Roben.
2666
2667         Add and implement LayerTreeHost::scheduleLayerFlush
2668         https://bugs.webkit.org/show_bug.cgi?id=53135
2669
2670         * WebKit2.xcodeproj/project.pbxproj:
2671         Add LayerTreeHostMac.mm.
2672
2673         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2674         (WebKit::DrawingAreaImpl::scheduleCompositingLayerSync):
2675         Call LayerTreeHost::scheduleLayerFlush.
2676
2677         * WebProcess/WebPage/LayerTreeHost.cpp:
2678         (WebKit::LayerTreeHost::~LayerTreeHost):
2679         Call platformInvalidate().
2680
2681         (WebKit::LayerTreeHost::flushPendingLayerChanges):
2682         Rename from syncCompositingLayers.
2683
2684         * WebProcess/WebPage/mac/LayerTreeHostMac.mm: Added.
2685         (WebKit::LayerTreeHost::scheduleLayerFlush):
2686         Create a run loop observer if needed. This code is copied from LayerBackedDrawingAreaMac.mm
2687
2688         (WebKit::LayerTreeHost::platformInvalidate):
2689         Invalidate the run loop observer.
2690
2691         (WebKit::LayerTreeHost::flushPendingLayerChangesRunLoopObserverCallback):
2692         Call flushPendingChanges() and remove the run loop observer if it succeeded.
2693
2694 2011-01-25  Anders Carlsson  <andersca@apple.com>
2695
2696         Reviewed by Simon Fraser.
2697
2698         Add LayerTreeHost class
2699         https://bugs.webkit.org/show_bug.cgi?id=53132
2700
2701         * WebKit2.xcodeproj/project.pbxproj:
2702         Add LayerTreeHost files.
2703
2704         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2705         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
2706         Initialize m_layerTreeHost.
2707
2708         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
2709         Call the m_layerTreeHost.
2710
2711         * WebProcess/WebPage/LayerTreeHost.cpp: Added.
2712         (WebKit::LayerTreeHost::attachRootCompositingLayer):
2713         (WebKit::LayerTreeHost::detachRootCompositingLayer):
2714         Add stubbed out functions.
2715
2716         (WebKit::LayerTreeHost::syncCompositingLayers):
2717         Sync the compositing layers in the main frame.
2718
2719         * WebProcess/WebPage/LayerTreeHost.h: Added.
2720
2721 2011-01-25  Steve Falkenburg  <sfalken@apple.com>
2722
2723         Rubber-stamped by Adam Roben.
2724
2725         Windows production build fix.
2726         Use correct environment variable escaping
2727
2728         * win/WebKit2.make:
2729         * win/WebKit2Generated.make:
2730
2731 2011-01-25  Anders Carlsson  <andersca@apple.com>
2732
2733         Reviewed by Sam Weinig.
2734
2735         Don't inform the UI process about compositing changes when using the new drawing area
2736         https://bugs.webkit.org/show_bug.cgi?id=53120
2737
2738         * WebProcess/WebPage/WebPage.cpp:
2739         (WebKit::WebPage::changeAcceleratedCompositingMode):
2740         Return early if we're using the new drawing area.
2741
2742         (WebKit::WebPage::exitAcceleratedCompositingMode):
2743         Call setRootCompositingLayer(0) so the drawing area knows when we leave accelerated compositing.
2744
2745 2011-01-25  Sam Weinig  <sam@webkit.org>
2746
2747         Reviewed by Anders Carlsson.
2748
2749         Pipe a timestamp down into the PlatformWheelEvent for the Mac.
2750         https://bugs.webkit.org/show_bug.cgi?id=53111
2751
2752         * Shared/WebEventConversion.cpp:
2753         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
2754         Assign the timestamp.
2755
2756 2011-01-25  Sam Weinig  <sam@webkit.org>
2757
2758         Reviewed by Anders Carlsson.
2759
2760         Add hasPreciseScrollingDeltas bit to PlatformWheelEvent on the Mac.
2761         https://bugs.webkit.org/show_bug.cgi?id=53107
2762
2763         * Shared/WebEvent.h:
2764         (WebKit::WebWheelEvent::hasPreciseScrollingDeltas):
2765         * Shared/WebEventConversion.cpp:
2766         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
2767         * Shared/WebWheelEvent.cpp:
2768         (WebKit::WebWheelEvent::WebWheelEvent):
2769         * Shared/mac/WebEventFactory.mm:
2770         (WebKit::WebEventFactory::createWebWheelEvent):
2771
2772 2011-01-25  Anders Carlsson  <andersca@apple.com>
2773
2774         Reviewed by Sam Weinig.
2775
2776         need a way to request the host CALayer render server port
2777         https://bugs.webkit.org/show_bug.cgi?id=53101
2778         <rdar://problem/8913620>
2779
2780         * PluginProcess/PluginControllerProxy.cpp:
2781         (WebKit::PluginControllerProxy::compositingRenderServerPort):
2782         Get the render server port from the plug-in process.
2783
2784         * PluginProcess/PluginControllerProxy.h:
2785         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2786         (WebKit::NPN_GetValue):
2787         Call NetscapePlugin::compositingRenderServerPort.
2788
2789         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2790         (WebKit::NetscapePlugin::compositingRenderServerPort):
2791         Call PluginController::compositingRenderServerPort.
2792
2793         * WebProcess/Plugins/PluginView.cpp:
2794         (WebKit::PluginView::compositingRenderServerPort):
2795         Get the render server port from the web process.
2796
2797         * WebProcess/Plugins/PluginView.h:
2798         Add compositingRenderServerPort.
2799
2800 2011-01-25  Maciej Stachowiak  <mjs@apple.com>
2801
2802         Rubber stamped by Dan Bernstein.
2803
2804         Change some floating point constants from 1.0 to 1.
2805
2806         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2807         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
2808
2809 2011-01-25  Maciej Stachowiak  <mjs@apple.com>
2810
2811         Reviewed by Anders Carlsson.
2812
2813         Improve scale factor resetting
2814         https://bugs.webkit.org/show_bug.cgi?id=53093
2815         
2816         Two key changes:
2817         - Don't set the scale factor to what it already is, as this causes an
2818         uneeded force layout and scroll
2819         - Don't ever set the scale factor based on a non-main frame committing
2820         
2821         This fixes two WebKit2 layout tests.
2822
2823         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2824         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
2825
2826 2011-01-24  Chris Marrin  <cmarrin@apple.com>
2827
2828         Reviewed by Eric Seidel.
2829
2830         Change ENABLE_3D_CANVAS to ENABLE_WEBGL
2831         https://bugs.webkit.org/show_bug.cgi?id=53041
2832
2833         * Configurations/FeatureDefines.xcconfig:
2834
2835 2011-01-25  Andreas Kling  <kling@webkit.org>
2836
2837         Reviewed by Kenneth Rohde Christiansen.
2838
2839         [Qt][WK2] Add QWKPage::processCrashed() signal
2840         https://bugs.webkit.org/show_bug.cgi?id=53076
2841
2842         * UIProcess/API/qt/qwkpage.cpp:
2843         (QWKPagePrivate::processDidCrash):
2844         * UIProcess/API/qt/qwkpage.h:
2845         * UIProcess/API/qt/qwkpage_p.h:
2846
2847 2011-01-24  Anders Carlsson  <andersca@apple.com>
2848
2849         Fix build.
2850         
2851         * WebProcess/mac/WebProcessMac.mm:
2852         (WebKit::initializeSandbox):
2853
2854 2011-01-24  Anders Carlsson  <andersca@apple.com>
2855
2856         Reviewed by Dan Bernstein.
2857
2858         Reset the page scale factor on standard frame loads
2859         https://bugs.webkit.org/show_bug.cgi?id=53058
2860         <rdar://problem/8908844>
2861
2862         * UIProcess/WebPageProxy.cpp:
2863         (WebKit::WebPageProxy::scaleWebView):
2864         Don't set m_viewScaleFactor here. It will be set in viewScaleFactorDidChange.
2865
2866         (WebKit::WebPageProxy::viewScaleFactorDidChange):
2867         Update m_viewScaleFactor.
2868
2869         * UIProcess/WebPageProxy.h:
2870         Add viewScaleFactorDidChange.
2871
2872         * UIProcess/WebPageProxy.messages.in:
2873         Add ViewScaleFactorDidChange message.
2874
2875         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2876         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
2877         Set the scale factor.
2878
2879         (WebKit::WebFrameLoaderClient::restoreViewState):
2880         Inform the UI process about the new view scale factor.
2881
2882         * WebProcess/WebPage/WebPage.cpp:
2883         (WebKit::WebPage::scaleWebView):
2884         Send a ViewScaleFactorDidChange message.
2885
2886 2011-01-24  Maciej Stachowiak  <mjs@apple.com>
2887
2888         Reviewed by Anders Carlsson.
2889
2890         Use designated temp directory for the database for WebKit2
2891         https://bugs.webkit.org/show_bug.cgi?id=53052
2892         
2893         Add the API necessary to support this. Database path is now
2894         determined on the UI process side and passed to the Web process.
2895         Reviewed by Anders Carlsson.
2896
2897         * GNUmakefile.am:
2898         * Shared/WebProcessCreationParameters.cpp:
2899         (WebKit::WebProcessCreationParameters::encode):
2900         (WebKit::WebProcessCreationParameters::decode):
2901         * Shared/WebProcessCreationParameters.h:
2902         * UIProcess/API/C/WKContext.cpp:
2903         (WKContextSetDatabaseDirectory):
2904         * UIProcess/API/C/WKContextPrivate.h:
2905         * UIProcess/WebContext.cpp:
2906         (WebKit::WebContext::ensureWebProcess):
2907         (WebKit::WebContext::databaseDirectory):
2908         * UIProcess/WebContext.h:
2909         (WebKit::WebContext::setDatabaseDirectory):
2910         * UIProcess/mac/WebContextMac.mm:
2911         (WebKit::WebContext::platformDefaultDatabaseDirectory):
2912         * UIProcess/qt/WebContextQt.cpp:
2913         (WebKit::WebContext::platformDefaultDatabaseDirectory):
2914         * UIProcess/win/WebContextWin.cpp:
2915         (WebKit::WebContext::platformDefaultDatabaseDirectory):
2916         * WebKit2.pro:
2917         * WebKit2.xcodeproj/project.pbxproj:
2918         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
2919         (WebKit::WebDatabaseManager::initialize):
2920         (WebKit::WebDatabaseManager::WebDatabaseManager):
2921         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
2922         * WebProcess/WebCoreSupport/gtk/WebDatabaseManagerGtk.cpp: Removed.
2923         * WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm: Removed.
2924         * WebProcess/WebCoreSupport/qt/WebDatabaseManagerQt.cpp: Removed.
2925         * WebProcess/WebCoreSupport/win/WebDatabaseManagerWin.cpp: Removed.
2926         * WebProcess/WebProcess.cpp:
2927         (WebKit::WebProcess::WebProcess):
2928         (WebKit::WebProcess::initializeWebProcess):
2929         * WebProcess/com.apple.WebProcess.sb:
2930         * WebProcess/mac/WebProcessMac.mm:
2931         (WebKit::initializeSandbox):
2932         * win/WebKit2.vcproj:
2933
2934 2011-01-24  Brent Fulgham  <bfulgham@webkit.org>
2935
2936         Unreviewed build fix.
2937
2938         * win/WebKit2.vcproj: Don't build the CG Utilities when building
2939         without CG support.
2940
2941 2011-01-24  Anders Carlsson  <andersca@apple.com>
2942
2943         Reviewed by John Sullivan.
2944
2945         Don't use the timeout checker for non-user-interaction messages
2946         https://bugs.webkit.org/show_bug.cgi?id=53046
2947
2948         * UIProcess/ChunkedUpdateDrawingAreaProxy.cpp:
2949         (WebKit::ChunkedUpdateDrawingAreaProxy::didSetSize):
2950         (WebKit::ChunkedUpdateDrawingAreaProxy::sendSetSize):
2951         * UIProcess/LayerBackedDrawingAreaProxy.cpp:
2952         (WebKit::LayerBackedDrawingAreaProxy::sizeDidChange):
2953         (WebKit::LayerBackedDrawingAreaProxy::didSetSize):
2954
2955 2011-01-24  Adam Roben  <aroben@apple.com>
2956
2957         Windows Production build fix
2958
2959         * win/WebKit2.make: Update for move of WebKit2 into Source.
2960
2961 2011-01-24  Jessie Berlin  <jberlin@apple.com>
2962
2963         Reviewed by Adam Roben.
2964
2965         WebKit2: LayoutTests: The UNIMPLEMENTED warnings in TextCheckerWin should be disabled
2966         https://bugs.webkit.org/show_bug.cgi?id=53029
2967
2968         * UIProcess/win/TextCheckerWin.cpp:
2969         Disable the warnings for this file.
2970
2971 2011-01-24  Anders Carlsson  <andersca@apple.com>
2972
2973         Reviewed by Sam Weinig.
2974
2975         Wait for half a second if we're asked to paint when receiving a DidSetSize message
2976         https://bugs.webkit.org/show_bug.cgi?id=53028
2977
2978         * UIProcess/DrawingAreaProxyImpl.cpp:
2979         (WebKit::DrawingAreaProxyImpl::paint):
2980
2981 2011-01-24  Anders Carlsson  <andersca@apple.com>
2982
2983         Reviewed by Sam Weinig.
2984
2985         Implement forceRedisplay in the new drawing area
2986         https://bugs.webkit.org/show_bug.cgi?id=53026
2987
2988         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2989         (WebKit::DrawingAreaImpl::forceRepaint):
2990         * WebProcess/WebPage/DrawingAreaImpl.h:
2991
2992 2011-01-24  Anders Carlsson  <andersca@apple.com>
2993
2994         Reviewed by Sam Weinig.
2995
2996         Fill unpainted rects with the background color.
2997         https://bugs.webkit.org/show_bug.cgi?id=53025
2998
2999         * UIProcess/API/mac/WKView.mm:
3000         (drawPageBackground):
3001         Add new helper function.
3002
3003         (-[WKView drawRect:]):
3004         Iterate over the unpainted rects and fill them with the background color.
3005
3006 2011-01-24  Dan Bernstein  <mitz@apple.com>
3007
3008         Reviewed by John Sullivan.
3009
3010         WebKit2 version of <rdar://problem/6097826> Mail's cursor does not become a resize cursor when moving mouse from scrolled email to the horizontal splitter
3011
3012         * UIProcess/API/mac/PageClientImpl.mm:
3013         (WebKit::PageClientImpl::setCursor): If the current cursor comes from a cursor rect, do not override it.
3014
3015 2011-01-24  Balazs Kelemen  <kbalazs@webkit.org>
3016
3017         Rubber-stamped by Csaba Osztrogonác.
3018
3019         Typo fix.
3020
3021         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
3022         (WebKit::ProcessLauncher::launchProcess): Move the bracket to the right place.
3023
3024 2011-01-24  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
3025
3026         Reviewed by Kenneth Rohde Christiansen.
3027
3028         [Qt] Remove CleanupHandler by passing file descriptors.
3029
3030         Deleting files in signal handler of UI process is not a good idea,
3031         because the memory where filenames are stored might not be valid
3032         after a crash.
3033
3034         To avoid the need of using signal handlers for cleanup,
3035         change following:
3036           1) Avoid passing filenames between processes, pass fds
3037           2) When mmap'ing files, delete them immediately after
3038              opening and mmap'ing them.
3039           3) Pass sockets with fds during fork+exec instead of
3040              passing them via the filesystem.
3041           4) Use mmap'ed files for implementation of SharedMemory.
3042              QSharedMemory does not support cleanup correctly.
3043
3044         Consquences:
3045           - Move MappedMemory to SharedMemory, make UpdateChunk use this.
3046           - Implement CoreIPC::Attachment using mmaped files.
3047           - Send messages using datagram socket. This solution works
3048             similiarly to Mach ports on Mac.
3049           - Send big messages out-of-line and thus avoid increasing
3050             the receive buffer.
3051           - Remove MemoryMappedPool and rely on libc/kernel caching
3052             of mmapped areas.
3053           - Unmap memory areas after use.
3054           - When UI process crashes, kill the web process using SIGKILL.
3055             This is possible again because cleanup handler is not needed.
3056
3057         [WK2][Qt] Multiple problems with MemoryMappedPool
3058         https://bugs.webkit.org/show_bug.cgi?id=51984
3059
3060         * Platform/CoreIPC/Attachment.cpp:
3061         (CoreIPC::Attachment::Attachment):
3062         * Platform/CoreIPC/Attachment.h:
3063         (CoreIPC::Attachment::size):
3064         (CoreIPC::Attachment::releaseFileDescriptor):
3065         (CoreIPC::Attachment::fileDescriptor):
3066         * Platform/CoreIPC/Connection.h:
3067         * Platform/CoreIPC/qt/ConnectionQt.cpp:
3068         (CoreIPC::MessageInfo::MessageInfo):
3069         (CoreIPC::MessageInfo::setMessageBodyOOL):
3070         (CoreIPC::MessageInfo::isMessageBodyOOL):
3071         (CoreIPC::MessageInfo::bodySize):
3072         (CoreIPC::MessageInfo::messageID):
3073         (CoreIPC::MessageInfo::attachmentCount):
3074         (CoreIPC::Connection::platformInitialize):
3075         (CoreIPC::Connection::platformInvalidate):
3076         (CoreIPC::SocketNotifierDisableGuard::SocketNotifierDisableGuard):
3077         (CoreIPC::SocketNotifierDisableGuard::~SocketNotifierDisableGuard):
3078         (CoreIPC::Connection::readyReadHandler):
3079         (CoreIPC::Connection::open):
3080         (CoreIPC::Connection::platformCanSendOutgoingMessages):
3081         (CoreIPC::Connection::sendOutgoingMessage):
3082         * Platform/SharedMemory.h:
3083         * Platform/WorkQueue.h:
3084         * Platform/qt/MappedMemoryPool.cpp: Removed.
3085         * Platform/qt/MappedMemoryPool.h: Removed.
3086         * Platform/qt/SharedMemoryQt.cpp:
3087         (WebKit::SharedMemory::Handle::Handle):
3088         (WebKit::SharedMemory::Handle::~Handle):
3089         (WebKit::SharedMemory::Handle::isNull):
3090         (WebKit::SharedMemory::Handle::encode):
3091         (WebKit::SharedMemory::Handle::decode):
3092         (WebKit::SharedMemory::Handle::releaseToAttachment):
3093         (WebKit::SharedMemory::Handle::adoptFromAttachment):
3094         (WebKit::SharedMemory::create):
3095         (WebKit::accessModeMMap):
3096         (WebKit::SharedMemory::~SharedMemory):
3097         (WebKit::accessModeFile):
3098         (WebKit::SharedMemory::createHandle):
3099         * Platform/qt/WorkQueueQt.cpp:
3100         (WorkQueue::registerSocketEventHandler):
3101         * Shared/qt/UpdateChunk.cpp:
3102         (WebKit::UpdateChunk::UpdateChunk):
3103         (WebKit::UpdateChunk::~UpdateChunk):
3104         (WebKit::UpdateChunk::encode):
3105         (WebKit::UpdateChunk::decode):
3106         (WebKit::UpdateChunk::createImage):
3107         * Shared/qt/UpdateChunk.h:
3108         * UIProcess/Launcher/ProcessLauncher.h:
3109         * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
3110         (WebKit::QtWebProcess::QtWebProcess):
3111         (WebKit::QtWebProcess::setupChildProcess):
3112         (WebKit::ProcessLauncher::launchProcess):
3113         (WebKit::ProcessLauncher::platformInvalidate):
3114         * UIProcess/Launcher/qt/ThreadLauncherQt.cpp:
3115         (WebKit::webThreadBody):
3116         (WebKit::ThreadLauncher::createWebThread):
3117         * WebKit2.pro:
3118         * WebProcess/qt/WebProcessMainQt.cpp:
3119         (WebKit::WebProcessMainQt):
3120
3121 2011-01-24  Andras Becsi  <abecsi@webkit.org>
3122
3123         Reviewed by Csaba Osztrogonác.
3124
3125         [Qt] Move project files into Source
3126         https://bugs.webkit.org/show_bug.cgi?id=52891
3127
3128         * DerivedSources.pro:
3129         * WebKit2.pro:
3130         * WebProcess.pro:
3131
3132 2011-01-23  Damian Kaleta  <dkaleta@apple.com>
3133
3134         Reviewed by Kevin Decker.
3135
3136         <rdar://problem/8905171>
3137         https://bugs.webkit.org/show_bug.cgi?id=52985 
3138
3139         * UIProcess/WebPageProxy.cpp:
3140         (WebKit::WebPageProxy::scaleWebView): Eliminated early return inside WebPageProxy::scaleWebView, making it 
3141         consistent with WebKit1.
3142
3143 2011-01-23  Alexey Proskuryakov  <ap@apple.com>
3144
3145         Reviewed by Dan Bernstein.
3146
3147         https://bugs.webkit.org/show_bug.cgi?id=52968
3148         Use a separate NSView for printing
3149
3150         Also addresses <rdar://problem/8900148> Improper check for 
3151         -[NSGraphicsContext currentContextDrawingToScreen]
3152
3153         * UIProcess/API/mac/WKPrintingView.h: Added.
3154         * UIProcess/API/mac/WKPrintingView.mm: Added.
3155         (-[WKPrintingView initWithFrameProxy:]):
3156         (-[WKPrintingView isFlipped]):
3157         (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]):
3158         (-[WKPrintingView knowsPageRange:]):
3159         (-[WKPrintingView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
3160         (-[WKPrintingView drawPageBorderWithSize:]):
3161         (-[WKPrintingView _provideTotalScaleFactorForPrintOperation:]):
3162         (-[WKPrintingView rectForPage:]):
3163         * UIProcess/API/mac/WKView.mm:
3164         (-[WKView drawRect:]):
3165         (-[WKView canChangeFrameLayout:]):
3166         (-[WKView printOperationWithPrintInfo:forFrame:]):
3167         * WebKit2.xcodeproj/project.pbxproj:
3168         Moved printing code to a separate view, simplifying as appropriate. The view is currently not
3169         referenced by anything in WebKit2 directly, being owned by NSPrintOperation.
3170
3171 2011-01-22  Anders Carlsson  <andersca@apple.com>
3172
3173         Reviewed by Sam Weinig.
3174
3175         Transparent windows with compositing WebKit2 content show garbage
3176         https://bugs.webkit.org/show_bug.cgi?id=52966
3177         <rdar://problem/8765051>
3178
3179         * UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm:
3180         (WebKit::LayerBackedDrawingAreaProxy::paint):
3181         If the WKView should draw transparent background, do so.
3182
3183 2011-01-22  Anders Carlsson  <andersca@apple.com>
3184
3185         Reviewed by Sam Weinig.
3186
3187         Add an asynchronous WKPageForceRepaint
3188         https://bugs.webkit.org/show_bug.cgi?id=52964
3189         <rdar://problem/8898527>
3190
3191         * UIProcess/API/C/WKPage.cpp:
3192         (WKPageForceRepaint):
3193         Call WebPageProxy::forceRepaint.
3194
3195         * UIProcess/API/C/WKPage.h:
3196         Add WKPageForceRepaint.
3197
3198         * UIProcess/GenericCallback.h:
3199         Add a "generic" VoidCallback class.
3200
3201         * UIProcess/WebPageProxy.cpp:
3202         (WebKit::WebPageProxy::forceRepaint):
3203         Insert the callback in the m_voidCallbacks map and send a forceRepaint message.
3204
3205         (WebKit::WebPageProxy::voidCallback):
3206         Call the right void callback.
3207
3208         (WebKit::WebPageProxy::processDidCrash):
3209         Invalidate m_voidCallbacks.
3210
3211         * UIProcess/WebPageProxy.messages.in:
3212         Add a VoidCallback message.
3213
3214         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
3215         (WebKit::ChunkedUpdateDrawingArea::forceRepaint):
3216         Force a repaint.
3217
3218         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
3219         Add forceRepaint.
3220
3221         * WebProcess/WebPage/WebPage.cpp:
3222         (WebKit::WebPage::forceRepaint):
3223         Call forceRepaint on the drawing area.
3224
3225         * WebProcess/WebPage/WebPage.messages.in:
3226         Add a ForceRepaint message.
3227
3228 2011-01-21  Nikolas Zimmermann  <nzimmermann@rim.com>
3229
3230         Reviewed by Dirk Schulze.
3231
3232         Introduce FontMetrics abstraction
3233         https://bugs.webkit.org/show_bug.cgi?id=51456
3234
3235         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Use FontMetrics instead of Font to access the metrics.
3236         (WebKit::WebPopupMenu::setUpPlatformData):
3237
3238 2011-01-22  Alexey Proskuryakov  <ap@apple.com>
3239
3240         Reviewed by Dan Bernstein.
3241
3242         https://bugs.webkit.org/show_bug.cgi?id=52950
3243         Leak in WebPage::drawRectToPDF
3244
3245         * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::drawRectToPDF): Use RetainPtr here, too.
3246
3247 2011-01-22  Alexey Proskuryakov  <ap@apple.com>
3248
3249         Reviewed by Dan Bernstein.
3250
3251         https://bugs.webkit.org/show_bug.cgi?id=52951
3252         WebKit2 generates a bad PDF for cross process messaging
3253
3254         * UIProcess/API/mac/WKView.mm:
3255         (-[WKView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
3256         Use a correct offset when flipping.
3257
3258 2011-01-21  Alexey Proskuryakov  <ap@apple.com>
3259
3260         Reviewed by Dan Bernstein.
3261
3262         https://bugs.webkit.org/show_bug.cgi?id=52943
3263         Objective-C files should use #import, not #include
3264
3265         * UIProcess/API/C/WebKit2.h: This is an interesting one, because it's cross-platform, and
3266         there is more than one WKView.h.
3267
3268         * Platform/mac/ModuleMac.mm:
3269         * Platform/mac/RunLoopMac.mm:
3270         * PluginProcess/mac/PluginControllerProxyMac.mm:
3271         * PluginProcess/mac/PluginProcessMac.mm:
3272         * PluginProcess/mac/PluginProcessMainMac.mm:
3273         * Shared/API/c/mac/WKCertificateInfoMac.mm:
3274         * Shared/API/c/mac/WKURLRequestNS.mm:
3275         * Shared/API/c/mac/WKURLResponseNS.mm:
3276         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3277         * Shared/mac/PlatformCertificateInfo.mm:
3278         * Shared/mac/SandboxExtensionMac.mm:
3279         * Shared/mac/WebCoreArgumentCodersMac.mm:
3280         * Shared/mac/WebMemorySampler.mac.mm:
3281         * Shared/mac/WebURLRequestMac.mm:
3282         * Shared/mac/WebURLResponseMac.mm:
3283         * UIProcess/API/mac/FindIndicatorWindow.mm:
3284         * UIProcess/API/mac/WKTextInputWindowController.mm:
3285         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3286         * UIProcess/Launcher/mac/ThreadLauncherMac.mm:
3287         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
3288         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3289         * UIProcess/mac/BackingStoreMac.mm:
3290         * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
3291         * UIProcess/mac/LayerBackedDrawingAreaProxyMac.mm:
3292         * UIProcess/mac/TextCheckerMac.mm:
3293         * UIProcess/mac/WebContextMac.mm:
3294         * UIProcess/mac/WebContextMenuProxyMac.mm:
3295         * UIProcess/mac/WebPageProxyMac.mm:
3296         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3297         * UIProcess/mac/WebPreferencesMac.mm:
3298         * WebProcess/Downloads/mac/DownloadMac.mm:
3299         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3300         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
3301         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
3302         * WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm:
3303         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3304         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
3305         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
3306         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
3307         * WebProcess/WebPage/mac/WebPageMac.mm:
3308         * WebProcess/mac/WebProcessMac.mm:
3309
3310 2011-01-21  Mark Rowe  <mrowe@apple.com>
3311
3312         Reviewed by Sam Weinig.
3313
3314         Fix the WebKit2 build with clang.
3315
3316         * Scripts/webkit2/messages.py: Add some more structs to the list.
3317         * UIProcess/DrawingAreaProxy.h: Forward-declare UpdateInfo as a class.
3318         * UIProcess/TextChecker.h: Forward-declare TextCheckerState as a struct.
3319         * UIProcess/WebPageProxy.h: Forward-declare ContextMenuState as a struct.
3320         * UIProcess/mac/TextCheckerMac.mm: Fix the type of the string constants so that they can be passed to
3321         functions expecting NSString* without generating warnings.
3322         * WebProcess/WebPage/DrawingArea.h: Forward-declare WebPageCreationParameters as a struct.
3323         * WebProcess/WebPage/DrawingAreaImpl.h: Forward-declare UpdateInfo as a class.
3324         * WebProcess/WebPage/WebPage.cpp:
3325         (WebKit::WebPage::getResourceDataFromFrame): Add parens around the assignment in the condition of
3326         the if statement to suppress a warning.
3327
3328 2011-01-21  Brian Weinstein  <bweinstein@apple.com>
3329
3330         Reviewed by Adam Roben.
3331
3332         WebKit2: Need API to stop loading a WKFrame
3333         https://bugs.webkit.org/show_bug.cgi?id=52925
3334
3335         * UIProcess/API/C/WKFrame.cpp:
3336         (WKFrameStopLoading): Call through to WebFrameProxy::stopLoading.
3337         * UIProcess/API/C/WKFrame.h:
3338         * UIProcess/WebFrameProxy.cpp:
3339         (WebKit::WebFrameProxy::stopLoading): Send a message to the WebProcess to stop loading the frame
3340             with the passed in ID.
3341         * UIProcess/WebFrameProxy.h:
3342         * WebProcess/WebPage/WebPage.cpp:
3343         (WebKit::WebPage::stopLoadingFrame): Call stopForUserCancel on the passed-in frame.
3344         * WebProcess/WebPage/WebPage.h:
3345         * WebProcess/WebPage/WebPage.messages.in: Add StopLoadingFrame.
3346
3347 2011-01-21  Brady Eidson  <beidson@apple.com>
3348
3349         Reviewed by Adam Roben.
3350
3351         <rdar://problem/8894125> and https://bugs.webkit.org/show_bug.cgi?id=52916
3352         Expose "suggested filename" for a resource based on its resource response.
3353
3354         API pieces:
3355         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3356         (WKBundleFrameCopySuggestedFilenameForResourceURL):
3357         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
3358         
3359         Implementation:
3360         * WebProcess/WebPage/WebFrame.cpp:
3361         (WebKit::WebFrame::suggestedFilenameForResourceURL): See if the DocumentLoader has
3362           a resource for this URL and, if so, return the response's suggested filename.
3363         * WebProcess/WebPage/WebFrame.h:
3364
3365 2011-01-21  Anders Carlsson  <andersca@apple.com>
3366
3367         Reviewed by Dan Bernstein.
3368
3369         DrawingAreaProxyImpl::paint should return the unpainted region
3370         https://bugs.webkit.org/show_bug.cgi?id=52918
3371
3372         * UIProcess/API/mac/WKView.mm:
3373         (-[WKView drawRect:]):
3374         Add unpaintedRegion parameter.
3375
3376         * UIProcess/BackingStore.h:
3377         (WebKit::BackingStore::size):
3378         Add a size getter.
3379
3380         * UIProcess/DrawingAreaProxyImpl.cpp:
3381         (WebKit::DrawingAreaProxyImpl::paint):
3382         Initialize the unpainted region to the dirty region, then subtract the painted region.
3383
3384 2011-01-21  Anders Carlsson  <andersca@apple.com>
3385
3386         Reviewed by Dan Bernstein and Maciej Stachowiak.
3387
3388         Fix for <rdar://problem/8896057>
3389
3390         Give the Web Process access to the PubSub agent.
3391
3392         * WebProcess/com.apple.WebProcess.sb:
3393
3394 2011-01-21  Sam Weinig  <sam@webkit.org>
3395
3396         Reviewed by Anders Carlsson.
3397
3398         Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
3399         https://bugs.webkit.org/show_bug.cgi?id=52779
3400
3401         Rename ScrollbarClient -> ScrollableArea.
3402
3403         * UIProcess/win/WebPopupMenuProxyWin.cpp:
3404         (WebKit::WebPopupMenuProxyWin::onMouseWheel):
3405         (WebKit::WebPopupMenuProxyWin::scrollToRevealSelection):
3406         * UIProcess/win/WebPopupMenuProxyWin.h:
3407
3408 2011-01-21  Adam Roben  <aroben@apple.com>
3409
3410         Update for WKCACFLayerRenderer -> CACFLayerView rename
3411
3412         Fixes <http://webkit.org/b/52898> WKCACFLayerRenderer sounds like a render object, but isn't
3413
3414         Reviewed by Simon Fraser.
3415
3416         * WebProcess/WebPage/win/LayerBackedDrawingAreaWin.cpp: Just removed all the unnecessary
3417         #includes.
3418
3419 2011-01-20  Darin Adler  <darin@apple.com>
3420
3421         Reviewed by Dan Bernstein.
3422
3423         WebKit2: Implement showModalDialog
3424         https://bugs.webkit.org/show_bug.cgi?id=52855
3425
3426         * Shared/WebPageCreationParameters.h: Added canRunModal.
3427
3428         * UIProcess/API/C/WKPage.h: Added a runModal function pointer to
3429         WKPageUIClient. Also removed a lot of redundant typedefs and added
3430         a new one, WKPageCallback, for callbacks without arguments or return
3431         values.
3432
3433         * UIProcess/API/qt/qwkpage.cpp:
3434         (QWKPage::QWKPage): Added a runModal function pointer of 0.
3435
3436         * UIProcess/WebPageProxy.cpp:
3437         (WebKit::WebPageProxy::creationParameters): Set canRunModal
3438         based on return value of WebUIClient::canRunModal.
3439
3440         * UIProcess/WebPageProxy.h: Added runModal.
3441         Calls WebUIClient::runModal.
3442
3443         * UIProcess/WebPageProxy.messages.in: Added RunModal message.
3444         Also removed the periods from the phrases in the comments
3445         as Maciej requested a while back.
3446
3447         * UIProcess/WebUIClient.cpp:
3448         (WebKit::WebUIClient::canRunModal): Added. Returns true or false
3449         based on whether a runModal function was supplied in the
3450         WKPageUIClient structure.
3451         (WebKit::WebUIClient::runModal): Added. Calls the runModal
3452         function from the WKPageUIClient structure.
3453         * UIProcess/WebUIClient.h: Declared the above functions.
3454
3455         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3456         (WebKit::WebChromeClient::canRunModal): Call through to WebPage.
3457         (WebKit::WebChromeClient::runModal): Ditto.
3458
3459         * WebProcess/WebPage/WebPage.cpp:
3460         (WebKit::WebPage::WebPage): Initialize m_canRunModal based on the
3461         creation parameters. Initialize m_isRunningModal to false.
3462         (WebKit::WebPage::close): Stop the nested run loop if we are running modal.
3463         (WebKit::WebPage::runModal): Send a message to ask the UI process to run
3464         modal and then start a nested run loop. It gets stopped when the page is closed.
3465         * WebProcess/WebPage/WebPage.h: Defined the canRunModal function
3466         and declared the runModal function.
3467
3468 2011-01-20  Alexey Proskuryakov  <ap@apple.com>
3469
3470         Reviewed by Darin Adler.
3471
3472         https://bugs.webkit.org/show_bug.cgi?id=52849
3473         Make window.print work with WebKit2
3474
3475         * UIProcess/API/qt/qwkpage.cpp:
3476         (QWKPage::QWKPage):
3477         * UIProcess/WebPageProxy.cpp:
3478         (WebKit::WebPageProxy::printFrame):
3479         * UIProcess/WebPageProxy.h:
3480         * UIProcess/WebPageProxy.messages.in:
3481         * UIProcess/WebUIClient.cpp:
3482         (WebKit::WebUIClient::printFrame):
3483         * UIProcess/WebUIClient.h:
3484         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3485         (WebKit::WebChromeClient::print):
3486         Just pass through deelagte call to a WebKit2 client.
3487
3488         * UIProcess/API/C/WKPage.h: Also added "Callback" suffix to other printing related function
3489         types.
3490
3491 2011-01-20  Anders Carlsson  <andersca@apple.com>
3492
3493         Reviewed by Darin Adler.
3494
3495         Keep track of the latest update timestamp in the backing store
3496         https://bugs.webkit.org/show_bug.cgi?id=52848
3497
3498         * Shared/UpdateInfo.h:
3499         (WebKit::UpdateInfo::UpdateInfo):
3500         Initialize timestamp to 0.
3501
3502         * UIProcess/BackingStore.cpp:
3503         (WebKit::BackingStore::BackingStore):
3504         Initialize m_latestUpdateTimestamp to 0.
3505
3506         (WebKit::BackingStore::incorporateUpdate):
3507         If the update is too old, discard it. Otherwise, create a bitmap
3508         and pass it to platformIncorporateUpdate. Finally update the timestamp.
3509
3510         * UIProcess/BackingStore.h:
3511         Add m_latestUpdateTimestamp.
3512
3513         * UIProcess/mac/BackingStoreMac.mm:
3514         (WebKit::BackingStore::platformIncorporateUpdate):
3515         Update now that we are already given the shareable bitmap.
3516
3517 2011-01-20  Beth Dakin  <bdakin@apple.com>
3518
3519         Reviewed by Geoffrey Garen.
3520
3521         Fix for <rdar://problem/8890255>
3522
3523         Allow WebKitSystemInterface to draw scrollbars 
3524         when appropriate.
3525         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3526         (InitWebCoreSystemInterface):
3527
3528 2011-01-20  Sam Weinig  <sam@webkit.org>
3529
3530         Reviewed by Dave Hyatt.
3531
3532         Cleanup Scrollbar/ScrollbarClient relationship
3533         https://bugs.webkit.org/show_bug.cgi?id=52779
3534
3535         * UIProcess/win/WebPopupMenuProxyWin.cpp:
3536         (WebKit::WebPopupMenuProxyWin::scrollPosition):
3537         (WebKit::WebPopupMenuProxyWin::setScrollOffset):
3538         (WebKit::WebPopupMenuProxyWin::scrollTo):
3539         (WebKit::WebPopupMenuProxyWin::onMouseWheel):
3540         (WebKit::WebPopupMenuProxyWin::scrollToRevealSelection):
3541         * UIProcess/win/WebPopupMenuProxyWin.h:
3542         (WebKit::WebPopupMenuProxyWin::verticalScrollbar):
3543
3544 2011-01-20  Anders Carlsson  <andersca@apple.com>
3545
3546         Reviewed by Adam Roben.
3547
3548         Add a timestamp to UpdateInfo
3549         https://bugs.webkit.org/show_bug.cgi?id=52844
3550
3551         * Shared/UpdateInfo.cpp:
3552         (WebKit::UpdateInfo::encode):
3553         (WebKit::UpdateInfo::decode):
3554         * Shared/UpdateInfo.h:
3555         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3556         (WebKit::DrawingAreaImpl::setSize):
3557         (WebKit::DrawingAreaImpl::display):
3558
3559 2011-01-20  Anders Carlsson  <andersca@apple.com>
3560
3561         Reviewed by Beth Dakin.
3562
3563         Add Connection::waitForAndDispatchImmediately
3564         https://bugs.webkit.org/show_bug.cgi?id=52841
3565
3566         * Platform/CoreIPC/Connection.h:
3567         (CoreIPC::Connection::waitForAndDispatchImmediately):
3568
3569 2011-01-20  Kevin Decker  <kdecker@apple.com>
3570
3571         Reviewed by Anders Carlsson.
3572
3573         <rdar://problem/8880689> need a way to obtain the rendered rectangle for box elements
3574         https://bugs.webkit.org/show_bug.cgi?id=52823
3575         
3576         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
3577         (WKBundleNodeHandleGetRenderRect): Added new method that will return a rendered rectangle for box elements
3578         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: Ditto.
3579         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: Ditto.
3580         (WebKit::InjectedBundleNodeHandle::renderRect): Ditto.
3581         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: Ditto.
3582
3583 2011-01-20  Kimmo Kinnunen  <kimmo.t.kinnunen@nokia.com>
3584
3585         Reviewed by Andreas Kling.
3586
3587         Remove null ptr deref that happens when reattaching to
3588         a new web process.
3589
3590         Implement didRelaunchProcess that sets the drawing area size
3591         after the drawing area is re-instantiated.
3592
3593         [Qt][WK2] Null ptr deref in UI process after web process has crashed
3594         https://bugs.webkit.org/show_bug.cgi?id=52796
3595
3596         * UIProcess/API/qt/qgraphicswkview.cpp:
3597         (QGraphicsWKView::QGraphicsWKView):
3598         * UIProcess/API/qt/qwkpage.cpp:
3599         (QWKPagePrivate::QWKPagePrivate):
3600         (QWKPagePrivate::init):
3601         (QWKPagePrivate::createDrawingAreaProxy):
3602         (QWKPagePrivate::didRelaunchProcess): Reset drawing area size after crash.
3603         * UIProcess/API/qt/qwkpage_p.h:
3604
3605 2011-01-20  Maciej Stachowiak  <mjs@apple.com>
3606
3607         Reviewed by Adam Roben.
3608
3609         WebKitTestRunner needs to support layoutTestController.evaluateScriptInIsolatedWorld
3610         https://bugs.webkit.org/show_bug.cgi?id=42327
3611         
3612         Added a new API call, WKBundleFrameForJavaScriptContext, that gets the WKBundleFrameRef
3613         that corresponds to a JSContextRef (or null if none).
3614
3615         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3616         (WKBundleFrameForJavaScriptContext): Simple wrapper, defers to a WebFrame
3617         static method.
3618         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
3619         * WebProcess/WebPage/WebFrame.cpp:
3620         (WebKit::WebFrame::frameForContext): Follow the maze of twisty pointers.
3621         * WebProcess/WebPage/WebFrame.h:
3622
3623 2011-01-20  Alejandro G. Castro  <alex@igalia.com>
3624
3625         Fix compilation error in GTK WebKit2.
3626
3627         * Platform/CoreIPC/gtk/ConnectionGtk.cpp:
3628         (CoreIPC::readBytesFromSocket):
3629         (CoreIPC::writeBytesToSocket):
3630
3631 2011-01-20  Zoltan Horvath  <zoltan@webkit.org>
3632
3633         Reviewed by Csaba Osztrogonác.
3634
3635         Refactoring of the custom allocation framework
3636         https://bugs.webkit.org/show_bug.cgi?id=49897
3637
3638         Inheriting from FastAllocBase can result in objects getting larger (bug #33896, #46589).
3639         The modification replaces Noncopyable and FastAllocBase classes and these inherits with their
3640         equivalent macro implementation at the necessary places.
3641
3642 2011-01-19  Simon Fraser  <simon.fraser@apple.com>
3643
3644         Fix the WebKit2 build.
3645
3646         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
3647         (WebKit::LayerBackedDrawingArea::syncCompositingLayers):
3648
3649 2011-01-19  Brian Weinstein  <bweinstein@apple.com>
3650
3651         Reviewed by Darin Adler.
3652
3653         WebKit2: Need API to get the parent frame of a frame
3654         https://bugs.webkit.org/show_bug.cgi?id=52774
3655         
3656         Add the API to get the parent frame of a frame.
3657
3658         * UIProcess/API/C/WKFrame.cpp:
3659         (WKFrameGetParentFrame):
3660         * UIProcess/API/C/WKFrame.h:
3661
3662 2011-01-19  Enrica Casucci  <enrica@apple.com>
3663
3664         Reviewed by Darin Adler.
3665
3666         WebKit2: add support for drag and drop
3667         https://bugs.webkit.org/show_bug.cgi?id=52343
3668         <rdar://problem/7660558>
3669         
3670         This patch contains the remaining work to support drag and drop on Mac.
3671         I've added a PasteboardTypes class to encapsulate all the pasteboard formats
3672         supported for drag and drop.
3673         In this implementation we don't support the promised types, since I could not
3674         find an efficient way to do this across processes.
3675         The bulk of the patch consists in creating a shareable bitmap for the drag image,
3676         pass its handle to the UI process and create a new NSImage from it to be given to
3677         AppKit for dragging.
3678         I've added the missing implementation of the methods in the drag client to hook
3679         up the placement of the data in the pasteboard.
3680         
3681         * Shared/mac/PasteboardTypes.h: Added.
3682         * Shared/mac/PasteboardTypes.mm: Added.
3683         (WebKit::PasteboardTypes::forEditing):
3684         (WebKit::PasteboardTypes::forURL):
3685         (WebKit::PasteboardTypes::forImages):
3686         (WebKit::PasteboardTypes::forImagesWithArchive):
3687         * UIProcess/API/mac/PageClientImpl.h:
3688         * UIProcess/API/mac/PageClientImpl.mm:
3689         (WebKit::PageClientImpl::setDragImage): Added.
3690         * UIProcess/API/mac/WKView.mm:
3691         (-[WKView _registerDraggedTypes]): Refactored to use the new PasteboardTypes class.
3692         (-[WKView initWithFrame:contextRef:pageGroupRef:]):
3693         (-[WKView _setMouseDownEvent:]):
3694         (-[WKView _mouseHandler:]):
3695         (-[WKView mouseDown:]):
3696         (-[WKView mouseUp:]):
3697         (-[WKView mouseDragged:]):
3698         (-[WKView draggedImage:endedAt:operation:]):
3699         (-[WKView draggingEntered:]):
3700         (-[WKView _setDragImage:at:linkDrag:]):
3701         * UIProcess/API/mac/WKViewInternal.h:
3702         * UIProcess/PageClient.h:
3703         * UIProcess/WebPageProxy.cpp:
3704         (WebKit::WebPageProxy::setDragImage):
3705         (WebKit::WebPageProxy::dragEnded):
3706         * UIProcess/WebPageProxy.h:
3707         * UIProcess/WebPageProxy.messages.in:
3708         * WebKit2.xcodeproj/project.pbxproj:
3709         * WebProcess/WebCoreSupport/WebDragClient.cpp:
3710         * WebProcess/WebCoreSupport/WebDragClient.h:
3711         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: Added.
3712         (WebKit::fontFromNSFont):
3713         (WebKit::WebDragClient::startDrag): Added implementation.
3714         (WebKit::WebDragClient::createDragImageForLink): Ditto.
3715         (WebKit::writeURL): Helper function.
3716         (WebKit::writeImage): Helper function.
3717         (WebKit::WebDragClient::declareAndWriteDragImage): Added implementation.
3718         * WebProcess/WebPage/WebPage.cpp:
3719         (WebKit::WebPage::dragEnded):
3720         * WebProcess/WebPage/WebPage.h:
3721         * WebProcess/WebPage/WebPage.messages.in:
3722
3723 2011-01-19  Anders Carlsson  <andersca@apple.com>
3724
3725         Reviewed by Dan Bernstein.
3726
3727         Put the deprecated Connection member functions next to eachother
3728         https://bugs.webkit.org/show_bug.cgi?id=52767
3729
3730         * Platform/CoreIPC/Connection.h:
3731         (CoreIPC::Connection::sendSync):
3732         (CoreIPC::Connection::send):
3733
3734 2011-01-19  Anders Carlsson  <andersca@apple.com>
3735
3736         Reviewed by Sam Weinig.
3737
3738         When resizing, the web process should repaint the page
3739         https://bugs.webkit.org/show_bug.cgi?id=52764
3740
3741         * UIProcess/DrawingAreaProxyImpl.cpp:
3742         (WebKit::DrawingAreaProxyImpl::didSetSize):
3743         Incorporate the update.
3744
3745         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
3746         Return early if the update bounds rect is empty. This can happen if painting is
3747         disabled and we get a DidSetSize message.
3748
3749         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3750         (WebKit::DrawingAreaImpl::setSize):
3751         If painting is disabled, just send back an empty UpdateInfo struct. Otherwise,
3752         paint and fill in the UpdateInfo struct.
3753
3754         (WebKit::DrawingAreaImpl::display):
3755         Assert that painting is not disabled.
3756
3757 2011-01-19  Alexey Proskuryakov  <ap@apple.com>
3758
3759         Reviewed by Darin Adler.
3760
3761         https://bugs.webkit.org/show_bug.cgi?id=52739
3762         Make it possible for a WebKit2 client to print headers and footers
3763
3764         * UIProcess/API/C/WKPage.h:
3765         * UIProcess/WebPageProxy.cpp:
3766         (WebKit::WebPageProxy::headerHeight):
3767         (WebKit::WebPageProxy::footerHeight):
3768         (WebKit::WebPageProxy::drawHeader):
3769         (WebKit::WebPageProxy::drawFooter):
3770         * UIProcess/WebPageProxy.h:
3771         * UIProcess/WebUIClient.cpp:
3772         (WebKit::WebUIClient::headerHeight):
3773         (WebKit::WebUIClient::footerHeight):
3774         (WebKit::WebUIClient::drawHeader):
3775         (WebKit::WebUIClient::drawFooter):
3776         * UIProcess/WebUIClient.h:
3777         Pass UIClient calls through.
3778
3779         * UIProcess/API/mac/WKView.mm:
3780         (currentPrintOperationScale): A helper to extract scale factor from the current NSPrintOperation.
3781         (-[WKView _adjustPrintingMarginsForHeaderAndFooter]): Copied from WebKit1. Change current
3782         print info to account for header and footer height as provided by the client.
3783         (-[WKView knowsPageRange:]): Call -[self _adjustPrintingMarginsForHeaderAndFooter].
3784         (-[WKView drawPageBorderWithSize:]): When AppKit asks to print page border, call the client
3785         to do that. Code adapted form WebKit1.
3786
3787         * UIProcess/API/qt/qwkpage:
3788         (QWKPage::QWKPage): Added zeroes for new WKPageUIClient members to avoid breaking the build.
3789
3790 2011-01-19  Jessie Berlin  <jberlin@apple.com>
3791
3792         Reviewed by Darin Adler.
3793
3794         Crash in WebDatabaseManagerProxy::getDatabaseOrigins when called after the WebProcess has
3795         died at least once
3796         https://bugs.webkit.org/show_bug.cgi?id=52730
3797
3798         WebDatabaseManagerProxy::invalidate was setting m_webContext to 0, and invalidate gets
3799         called in WebContext::processDidClose. However, m_webContext is only set in the
3800         constructor, which is only called from the constructor of WebContext, so attempting to send
3801         a message to any new WebProcess after the first one died was causing a null deref.
3802
3803         This patch moves setting m_webcontext into clearContext and clearContext is only called in
3804         the WebContext destructor.
3805
3806         This patch also adds checks for a valid WebProcessProxy before attempting to send messages to
3807         the WebProcessProxy so that if the WebProcess has died and has not been revived, it does not
3808         attempt to dereference a null WebProcessProxy.
3809
3810         * UIProcess/WebContext.cpp:
3811         (WebKit::WebContext::~WebContext):
3812         Call WebDatabaseManagerProxy::clearContext.
3813         * UIProcess/WebContext.h:
3814         (WebKit::WebContext::hasValidProcess):
3815         Make this method public so that it can be called from WebDatabaseManagerProxy.
3816
3817         * UIProcess/WebDatabaseManagerProxy.cpp:
3818         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
3819         If there isn't a valid process, invalidate the callback and return early.
3820         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
3821         Ditto.
3822         (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
3823         If tehre isn't a valid process return early.
3824         (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
3825         Ditto.
3826         (WebKit::WebDatabaseManagerProxy::deleteAllDatabases):
3827         Ditto.
3828         (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
3829         Ditto.
3830         (WebKit::WebDatabaseManagerProxy::invalidate):
3831         Move setting m_webContext to 0 from here ...
3832         * UIProcess/WebDatabaseManagerProxy.h:
3833         (WebKit::WebDatabaseManagerProxy::clearContext):
3834         ... to here.
3835
3836 2011-01-19  Anders Carlsson  <andersca@apple.com>
3837
3838         Reviewed by Sam Weinig.
3839
3840         Suspend/resume painting as the WKView visibility changes
3841         https://bugs.webkit.org/show_bug.cgi?id=52738
3842
3843         * UIProcess/DrawingAreaProxy.h:
3844         (WebKit::DrawingAreaProxy::visibilityDidChange):
3845         Add new member function. It should really be pure virtual once setPageIsVisible
3846         is removed.
3847
3848         * UIProcess/DrawingAreaProxyImpl.cpp:
3849         (WebKit::DrawingAreaProxyImpl::visibilityDidChange):
3850         Send SuspendPainting/ResumePainting messages based on whether the view is visible or not.
3851
3852         (WebKit::DrawingAreaProxyImpl::setPageIsVisible):
3853         Make this a stub; it should really be removed.
3854
3855         * UIProcess/WebPageProxy.cpp:
3856         (WebKit::WebPageProxy::viewStateDidChange):
3857         Call visibilityDidChange.
3858
3859         * UIProcess/WebPageProxy.h:
3860         (WebKit::WebPageProxy::isViewVisible):
3861         Add new getter.
3862
3863         * WebProcess/WebPage/DrawingArea.messages.in:
3864         Add SuspendPainting and ResumePainting messages.
3865
3866         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3867         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
3868         Initialize m_isPaintingSuspended.
3869
3870         (WebKit::DrawingAreaImpl::suspendPainting):
3871         Set m_isPaintingSuspended to true and stop the display timer.
3872
3873         (WebKit::DrawingAreaImpl::resumePainting):
3874         Set m_isPaintingSuspended to false.
3875
3876         (WebKit::DrawingAreaImpl::scheduleDisplay):
3877         (WebKit::DrawingAreaImpl::display):
3878         Bail if m_isPaintingSuspended is true.
3879
3880 2011-01-19  Andreas Kling  <kling@webkit.org>
3881
3882         Reviewed by Simon Hausmann.
3883
3884         [Qt][WK2] Implement formatLocalizedString() for Qt.
3885
3886         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3887         (WebKit::formatLocalizedString):
3888
3889 2011-01-19  Chris Marrin  <cmarrin@apple.com>
3890
3891         Reviewed by Simon Fraser.
3892
3893         WK2 - Multiple crashes in PlatformCALayer::replaceSublayer
3894         https://bugs.webkit.org/show_bug.cgi?id=52695
3895
3896         Added a hostingLayer as the parent of the existing drawingLayer.
3897         The hostingLayer is now the root which is passed to the 
3898         remote context. It never changes except to track the size
3899         of the window. The backingLayer is now a child of the 
3900         hostingLayer, which allow it to switch between tiled and
3901         non-tiled.
3902
3903         I also now give back accurate settings for debug borders and
3904         repaint counters.
3905
3906         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
3907         (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
3908         (WebKit::LayerBackedDrawingArea::setSize):
3909         (WebKit::LayerBackedDrawingArea::showDebugBorders):
3910         (WebKit::LayerBackedDrawingArea::showRepaintCounter):
3911         * WebProcess/WebPage/LayerBackedDrawingArea.h:
3912         * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm:
3913         (WebKit::LayerBackedDrawingArea::platformInit):
3914         (WebKit::LayerBackedDrawingArea::attachCompositingContext):
3915         (WebKit::LayerBackedDrawingArea::syncCompositingLayers):
3916
3917 2011-01-19  Anders Carlsson  <andersca@apple.com>
3918
3919         Reviewed by Sam Weinig.
3920
3921         Send a new SetSize message if the size differs from the current size
3922         https://bugs.webkit.org/show_bug.cgi?id=52728
3923
3924         * UIProcess/DrawingAreaProxy.h:
3925         (WebKit::DrawingAreaProxy::didSetSize):
3926         Add UpdateInfo parameter.
3927
3928         * UIProcess/DrawingAreaProxy.messages.in:
3929         Add UpdateInfo parameter to the DidSetSize message.
3930
3931         * UIProcess/DrawingAreaProxyImpl.cpp:
3932         (WebKit::DrawingAreaProxyImpl::didSetSize):
3933         If the view size differs from the current size send another SetSize message.
3934
3935         * UIProcess/DrawingAreaProxyImpl.h:
3936         Add UpdateInfo parameter to didSetSize.
3937
3938         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3939         (WebKit::DrawingAreaImpl::setSize):
3940         The DidSetSize message now takes an UpdateInfo parameter.
3941
3942 2011-01-19  Anders Carlsson  <andersca@apple.com>
3943
3944         Reviewed by Darin Adler.
3945
3946         Throttle sending of SetSize messages
3947         https://bugs.webkit.org/show_bug.cgi?id=52727
3948
3949         * UIProcess/DrawingAreaProxyImpl.cpp:
3950         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
3951         Initialize m_isWaitingForDidSetSize to false.
3952
3953         (WebKit::DrawingAreaProxyImpl::didSetSize):
3954         Null out the backing store.
3955
3956         (WebKit::DrawingAreaProxyImpl::sendSetSize):
3957         If m_isWaitingForDidSetSize is true, do nothing. Otherwise, set m_isWaitingForDidSetSize
3958         to true and send a SetSize message.
3959
3960         * UIProcess/DrawingAreaProxyImpl.h:
3961         Add m_isWaitingForDidSetSize.
3962
3963 2011-01-19  Anders Carlsson  <andersca@apple.com>
3964
3965         Reviewed by Darin Adler.
3966
3967         Pass WebPageCreationParameters to DrawingArea::create
3968         https://bugs.webkit.org/show_bug.cgi?id=52726
3969
3970         * WebProcess/WebPage/DrawingArea.cpp:
3971         (WebKit::DrawingArea::create):
3972         * WebProcess/WebPage/DrawingArea.h:
3973         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3974         (WebKit::DrawingAreaImpl::create):
3975         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
3976         * WebProcess/WebPage/DrawingAreaImpl.h:
3977         * WebProcess/WebPage/WebPage.cpp:
3978         (WebKit::WebPage::WebPage):
3979         (WebKit::WebPage::changeAcceleratedCompositingMode):
3980
3981 2011-01-19  Csaba Osztrogonác  <ossy@webkit.org>
3982
3983         Reviewed by Laszlo Gombos and Tor Arne Vestbø.
3984
3985         [Qt] Remove unnecessary "../Source" from paths
3986         after moving source files into Source is finished.
3987
3988         * DerivedSources.pro:
3989         * WebKit2.pro:
3990
3991 2011-01-18  Maciej Stachowiak  <mjs@apple.com>
3992
3993         Reviewed by Sam Weinig.
3994
3995         WebKitTestRunner should track loading more like DumpRenderTree
3996         https://bugs.webkit.org/show_bug.cgi?id=52692
3997         
3998         Relax the message check in didSaveFrameToPageCache a bit more, since
3999         layout tests were still hitting the old one.
4000
4001         * UIProcess/WebPageProxy.cpp:
4002         (WebKit::isDisconnectedFrame):
4003         (WebKit::WebPageProxy::didSaveFrameToPageCache):
4004
4005 2011-01-18  Brady Eidson  <beidson@apple.com>
4006
4007         Reviewed by Darin Adler.
4008
4009         <rdar://problem/8860833> and https://bugs.webkit.org/show_bug.cgi?id=52599
4010         UIProcess crash in WebPageProxy::reattachToWebProcess when web process crashes with a new tab/window.
4011
4012         * UIProcess/WebPageProxy.cpp:
4013         (WebKit::WebPageProxy::reattachToWebProcessWithItem): Null check item *both* places it is used.
4014
4015 2011-01-18  Brady Eidson  <beidson@apple.com>
4016
4017         Reviewed by Maciej Stachowiak. 
4018
4019         <rdar://problem/8752200> and https://bugs.webkit.org/show_bug.cgi?id=52664
4020         Need WebKit2 API to asynchronously get the resource data for a URL
4021
4022         Rename WKFrameGetMainResourceDataFunction to WKFrameGetResourceDataFunction, and add
4023         new API to get a resource by URL:
4024         * UIProcess/API/C/WKFrame.cpp:
4025         (WKFrameGetMainResourceData):
4026         (WKFrameGetResourceData):
4027         (callGetResourceDataBlockAndDispose):
4028         (WKFrameGetMainResourceData_b):
4029         (WKFrameGetResourceData_b):
4030         * UIProcess/API/C/WKFrame.h:
4031
4032         Implement the new API in the UIProcess side:
4033         * UIProcess/WebFrameProxy.cpp:
4034         (WebKit::WebFrameProxy::getResourceData):
4035         * UIProcess/WebFrameProxy.h:
4036         * UIProcess/WebPageProxy.cpp:
4037         (WebKit::WebPageProxy::getResourceDataFromFrame):
4038         * UIProcess/WebPageProxy.h:
4039
4040         Have the WebProcess get the data and call back to the UIProcess:
4041         * WebProcess/WebPage/WebPage.cpp:
4042         (WebKit::WebPage::getResourceDataFromFrame):
4043         * WebProcess/WebPage/WebPage.h:
4044         * WebProcess/WebPage/WebPage.messages.in:
4045
4046 2011-01-18  Anders Carlsson  <andersca@apple.com>
4047
4048         Reviewed by Dan Bernstein.
4049
4050         Make PageClientImpl::scrollView do hardware blitting
4051         https://bugs.webkit.org/show_bug.cgi?id=52689
4052
4053         * UIProcess/API/mac/PageClientImpl.mm:
4054         (WebKit::PageClientImpl::scrollView):
4055         Clip the scroll rect and scroll the view.
4056
4057         * UIProcess/DrawingAreaProxyImpl.cpp:
4058         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
4059         Scroll before painting.
4060
4061 2011-01-18  Anders Carlsson  <andersca@apple.com>
4062
4063         Reviewed by Darin Adler.
4064
4065         Artifacts when scrolling with new drawing area
4066         https://bugs.webkit.org/show_bug.cgi?id=52682
4067
4068         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4069         (WebKit::WebChromeClient::scroll):
4070         When scrolling, we want the intersection of the scroll rect and clip rect.
4071
4072 2011-01-18  Anders Carlsson  <andersca@apple.com>
4073
4074         Reviewed by Darin Adler.
4075
4076         Use a CGLayer for the backing store when possible
4077         https://bugs.webkit.org/show_bug.cgi?id=52679
4078
4079         * UIProcess/mac/BackingStoreMac.mm:
4080         (WebKit::BackingStore::paint):
4081         If there is a layer, paint it into the given context.
4082
4083         (WebKit::BackingStore::backingStoreContext):
4084         If we can get the containing window graphics context, use it to create a 
4085         CGLayer that we'll use for the backing store.
4086
4087         (WebKit::BackingStore::scroll):
4088         Paint the layer into itself.
4089
4090         * UIProcess/mac/WebPageProxyMac.mm:
4091         (WebKit::WebPageProxy::containingWindowGraphicsContext):
4092         Call the page client.
4093
4094 2011-01-18  Anders Carlsson  <andersca@apple.com>
4095
4096         Reviewed by Dan Bernstein.
4097
4098         Pass the web page proxy to BackingStore::create
4099         https://bugs.webkit.org/show_bug.cgi?id=52673
4100
4101         * UIProcess/BackingStore.cpp:
4102         (WebKit::BackingStore::create):
4103         Add WebPageProxy parameter.
4104     
4105         (WebKit::BackingStore::BackingStore):
4106         Add WebPageProxy parameter.
4107
4108         * UIProcess/BackingStore.h:
4109         Add WebPageProxy member variable.
4110
4111         * UIProcess/DrawingAreaProxyImpl.cpp:
4112         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
4113         Pass the web page proxy when creating the backing store.
4114
4115         * UIProcess/mac/BackingStoreMac.mm:
4116         (WebKit::BackingStore::backingStoreContext):
4117         Set the default blend mode.
4118
4119 2011-01-18  Anders Carlsson  <andersca@apple.com>
4120
4121         Reviewed by Darin Adler.
4122
4123         Factor code to create the backing store bitmap context out into a new function
4124         https://bugs.webkit.org/show_bug.cgi?id=52670
4125
4126         * UIProcess/BackingStore.h:
4127         * UIProcess/mac/BackingStoreMac.mm:
4128         (WebKit::BackingStore::backingStoreContext):
4129         Create the backing store context.
4130
4131         (WebKit::BackingStore::incorporateUpdate):
4132         Call backingStoreContext.
4133
4134         (WebKit::BackingStore::scroll):
4135         Assert that the context is not null.
4136
4137 2011-01-18  Anders Carlsson  <andersca@apple.com>
4138
4139         Reviewed by Dan Bernstein.
4140
4141         Add PageClientImpl::containingWindowGraphicsContext
4142         https://bugs.webkit.org/show_bug.cgi?id=52666
4143
4144         * UIProcess/API/mac/PageClientImpl.h:
4145         * UIProcess/API/mac/PageClientImpl.mm:
4146         (WebKit::PageClientImpl::containingWindowGraphicsContext):
4147         * UIProcess/PageClient.h:
4148         * UIProcess/WebPageProxy.h:
4149
4150 2011-01-18  Damian Kaleta  <dkaleta@apple.com>
4151
4152         Reviewed by Sam Weinig.
4153
4154         WK2 methods WKPageScaleWebView and WKPageGetViewScaleFactor need to have consistent names
4155         https://bugs.webkit.org/show_bug.cgi?id=52647
4156
4157         * UIProcess/API/C/WKPage.cpp:
4158         (WKPageSetScaleFactor):
4159         (WKPageGetScaleFactor):
4160         * UIProcess/API/C/WKPage.h:
4161
4162 2011-01-18  Anders Carlsson  <andersca@apple.com>
4163
4164         Reviewed by Dan Bernstein.
4165
4166         Ask the web page proxy to scroll the view when needed
4167         https://bugs.webkit.org/show_bug.cgi?id=52665
4168
4169         * UIProcess/DrawingAreaProxyImpl.cpp:
4170         (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
4171         * UIProcess/WebPageProxy.cpp:
4172         (WebKit::WebPageProxy::scrollView):
4173         * UIProcess/WebPageProxy.h:
4174
4175 2011-01-18  Anders Carlsson  <andersca@apple.com>
4176
4177         Fix build.
4178
4179         * UIProcess/win/WebView.cpp:
4180         (WebKit::WebView::scrollView):
4181
4182 2011-01-18  Anders Carlsson  <andersca@apple.com>
4183
4184         Reviewed by Sam Weinig.
4185
4186         Add PageClient::scrollView
4187         https://bugs.webkit.org/show_bug.cgi?id=52663
4188
4189         * UIProcess/API/mac/PageClientImpl.h:
4190         * UIProcess/API/mac/PageClientImpl.mm:
4191         (WebKit::PageClientImpl::scrollView):
4192         * UIProcess/API/qt/qwkpage.cpp:
4193         (QWKPagePrivate::scrollView):
4194         * UIProcess/API/qt/qwkpage_p.h:
4195         * UIProcess/PageClient.h:
4196         * UIProcess/win/WebView.cpp:
4197         (WebKit::PageClientImpl::scrollView):
4198         * UIProcess/win/WebView.h:
4199
4200 2011-01-18  Anders Carlsson  <andersca@apple.com>
4201
4202         Reviewed by Sam Weinig.
4203
4204         Rename scrollDelta to scrollOffset everywhere.
4205
4206         * Shared/UpdateInfo.cpp:
4207         (WebKit::UpdateInfo::encode):
4208         (WebKit::UpdateInfo::decode):
4209         * Shared/UpdateInfo.h:
4210         * UIProcess/BackingStore.h:
4211         * UIProcess/mac/BackingStoreMac.mm:
4212         (WebKit::BackingStore::incorporateUpdate):
4213         (WebKit::BackingStore::scroll):
4214         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
4215         (WebKit::WebChromeClient::scroll):
4216         (WebKit::WebChromeClient::delegatedScrollRequested):
4217         * WebProcess/WebCoreSupport/WebChromeClient.h:
4218         * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
4219         (WebKit::ChunkedUpdateDrawingArea::scroll):
4220         * WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
4221         * WebProcess/WebPage/DrawingArea.h:
4222         * WebProcess/WebPage/DrawingAreaImpl.cpp:
4223         (WebKit::DrawingAreaImpl::scroll):
4224         (WebKit::DrawingAreaImpl::display):
4225         * WebProcess/WebPage/DrawingAreaImpl.h:
4226         * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
4227         (WebKit::LayerBackedDrawingArea::scroll):
4228         * WebProcess/WebPage/LayerBackedDrawingArea.h:
4229
4230 2011-01-18  Anders Carlsson  <andersca@apple.com>
4231
4232         Reviewed by Sam Weinig.
4233
4234         Get and paint each individual rect in -[WKView drawRect:]
4235         https://bugs.webkit.org/show_bug.cgi?id=52660
4236
4237         * UIProcess/API/mac/WKView.mm:
4238         (-[WKView drawRect:]):
4239
4240 2011-01-18  Anders Carlsson  <andersca@apple.com>
4241
4242         Reviewed by Darin Adler.
4243
4244         Assertion when loading two URLs in quick succession
4245         https://bugs.webkit.org/show_bug.cgi?id=52649
4246         <rdar://problem/8764645>
4247
4248         If beginLoad is called twice without didStartProvisionalLoad being called in between,
4249         m_pendingProvisionalSandboxExtension would be non-null and an assert would fire.
4250
4251         * WebProcess/WebPage/WebPage.cpp:
4252         (WebKit::WebPage::SandboxExtensionTracker::beginLoad):
4253         Instead of asserting that m_pendingProvisionalSandboxExtension is null, invalidate it
4254         if it is not null, since that's valid.
4255
4256 2011-01-18  Anders Carlsson  <andersca@apple.com>
4257
4258         Reviewed by Sam Weinig.
4259
4260         Implement NPN_PopUpContextMenu
4261         https://bugs.webkit.org/show_bug.cgi?id=52646
4262         <rdar://problem/8735616>
4263