<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[37153] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/37153">37153</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2008-10-01 13:34:07 -0700 (Wed, 01 Oct 2008)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebCore:

2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;

        https://bugs.webkit.org/show_bug.cgi?id=21282
        
        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
        
        Reviewed by Adam Roben

        * loader/EmptyClients.h:
        (WebCore::EmptyChromeClient::screenToWindow):
        (WebCore::EmptyChromeClient::windowToScreen):
        * page/Chrome.cpp:
        (WebCore::Chrome::screenToWindow):
        (WebCore::Chrome::windowToScreen):
        * page/Chrome.h:
        * page/ChromeClient.h:
        * platform/HostWindow.h:
        * platform/ScrollView.cpp:
        (WebCore::ScrollView::contentsToScreen):
        (WebCore::ScrollView::screenToContents):
        (WebCore::ScrollView::platformContentsToScreen):
        (WebCore::ScrollView::platformScreenToContents):
        * platform/ScrollView.h:
        * platform/mac/ScrollViewMac.mm:
        (WebCore::ScrollView::platformContentsToScreen):
        (WebCore::ScrollView::platformScreenToContents):
        * platform/win/ScrollViewWin.cpp:

WebKit/gtk:

2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;

        https://bugs.webkit.org/show_bug.cgi?id=21282
        
        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
        
        Reviewed by Adam Roben

        * WebCoreSupport/ChromeClientGtk.cpp:
        (WebKit::ChromeClient::windowToScreen):
        (WebKit::ChromeClient::screenToWindow):
        * WebCoreSupport/ChromeClientGtk.h:

WebKit/mac:

2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;

        https://bugs.webkit.org/show_bug.cgi?id=21282
        
        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
        
        Reviewed by Adam Roben

        * WebCoreSupport/WebChromeClient.h:
        * WebCoreSupport/WebChromeClient.mm:
        (WebChromeClient::repaint):
        (WebChromeClient::screenToWindow):
        (WebChromeClient::windowToScreen):

WebKit/qt:

2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;
        
        https://bugs.webkit.org/show_bug.cgi?id=21282
        
        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
        
        Reviewed by Adam Roben

        * WebCoreSupport/ChromeClientQt.cpp:
        (WebCore::ChromeClientQt::windowToScreen):
        (WebCore::ChromeClientQt::screenToWindow):
        * WebCoreSupport/ChromeClientQt.h:

WebKit/win:

2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;
        
        https://bugs.webkit.org/show_bug.cgi?id=21282
        
        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
        
        Reviewed by Adam Roben

        * WebCoreSupport/WebChromeClient.cpp:
        (WebChromeClient::windowToScreen):
        (WebChromeClient::screenToWindow):
        * WebCoreSupport/WebChromeClient.h:

WebKit/wx:

2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;

        https://bugs.webkit.org/show_bug.cgi?id=21282
        
        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
    
        Reviewed by Adam Roben

        * WebKitSupport/ChromeClientWx.cpp:
        (WebCore::ChromeClientWx::windowToScreen):
        (WebCore::ChromeClientWx::screenToWindow):
        * WebKitSupport/ChromeClientWx.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreloaderEmptyClientsh">trunk/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkWebCorepageChromecpp">trunk/WebCore/page/Chrome.cpp</a></li>
<li><a href="#trunkWebCorepageChromeh">trunk/WebCore/page/Chrome.h</a></li>
<li><a href="#trunkWebCorepageChromeClienth">trunk/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkWebCoreplatformHostWindowh">trunk/WebCore/platform/HostWindow.h</a></li>
<li><a href="#trunkWebCoreplatformScrollViewcpp">trunk/WebCore/platform/ScrollView.cpp</a></li>
<li><a href="#trunkWebCoreplatformScrollViewh">trunk/WebCore/platform/ScrollView.h</a></li>
<li><a href="#trunkWebCoreplatformmacScrollViewMacmm">trunk/WebCore/platform/mac/ScrollViewMac.mm</a></li>
<li><a href="#trunkWebCoreplatformwinScrollViewWincpp">trunk/WebCore/platform/win/ScrollViewWin.cpp</a></li>
<li><a href="#trunkWebKitgtkChangeLog">trunk/WebKit/gtk/ChangeLog</a></li>
<li><a href="#trunkWebKitgtkWebCoreSupportChromeClientGtkcpp">trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp</a></li>
<li><a href="#trunkWebKitgtkWebCoreSupportChromeClientGtkh">trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h</a></li>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacWebCoreSupportWebChromeClienth">trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkWebKitmacWebCoreSupportWebChromeClientmm">trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm</a></li>
<li><a href="#trunkWebKitqtChangeLog">trunk/WebKit/qt/ChangeLog</a></li>
<li><a href="#trunkWebKitqtWebCoreSupportChromeClientQtcpp">trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp</a></li>
<li><a href="#trunkWebKitqtWebCoreSupportChromeClientQth">trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h</a></li>
<li><a href="#trunkWebKitwinChangeLog">trunk/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkWebKitwinWebCoreSupportWebChromeClientcpp">trunk/WebKit/win/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkWebKitwinWebCoreSupportWebChromeClienth">trunk/WebKit/win/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkWebKitwxChangeLog">trunk/WebKit/wx/ChangeLog</a></li>
<li><a href="#trunkWebKitwxWebKitSupportChromeClientWxcpp">trunk/WebKit/wx/WebKitSupport/ChromeClientWx.cpp</a></li>
<li><a href="#trunkWebKitwxWebKitSupportChromeClientWxh">trunk/WebKit/wx/WebKitSupport/ChromeClientWx.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebCore/ChangeLog        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;
+
+        https://bugs.webkit.org/show_bug.cgi?id=21282
+        
+        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
+        
+        Reviewed by Adam Roben
+
+        * loader/EmptyClients.h:
+        (WebCore::EmptyChromeClient::screenToWindow):
+        (WebCore::EmptyChromeClient::windowToScreen):
+        * page/Chrome.cpp:
+        (WebCore::Chrome::screenToWindow):
+        (WebCore::Chrome::windowToScreen):
+        * page/Chrome.h:
+        * page/ChromeClient.h:
+        * platform/HostWindow.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::contentsToScreen):
+        (WebCore::ScrollView::screenToContents):
+        (WebCore::ScrollView::platformContentsToScreen):
+        (WebCore::ScrollView::platformScreenToContents):
+        * platform/ScrollView.h:
+        * platform/mac/ScrollViewMac.mm:
+        (WebCore::ScrollView::platformContentsToScreen):
+        (WebCore::ScrollView::platformScreenToContents):
+        * platform/win/ScrollViewWin.cpp:
+
</ins><span class="cx"> 2008-10-01  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Adler.
</span></span></pre></div>
<a id="trunkWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/loader/EmptyClients.h (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/loader/EmptyClients.h        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebCore/loader/EmptyClients.h        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -114,6 +114,8 @@
</span><span class="cx">     virtual void updateBackingStore() { }
</span><span class="cx"> 
</span><span class="cx">     virtual void repaint(const IntRect&amp;, bool contentChanged, bool immediate = false) { }
</span><ins>+    virtual IntPoint screenToWindow(const IntPoint&amp; p) const { return p; }
+    virtual IntRect windowToScreen(const IntRect&amp; r) const { return r; }
</ins><span class="cx"> 
</span><span class="cx">     virtual void mouseDidMoveOverElement(const HitTestResult&amp;, unsigned modifierFlags) { }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCorepageChromecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/Chrome.cpp (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/Chrome.cpp        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebCore/page/Chrome.cpp        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -81,6 +81,16 @@
</span><span class="cx">     m_client-&gt;repaint(windowRect, contentChanged, immediate);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntPoint Chrome::screenToWindow(const IntPoint&amp; point) const
+{
+    return m_client-&gt;screenToWindow(point);
+}
+
+IntRect Chrome::windowToScreen(const IntRect&amp; rect) const
+{
+    return m_client-&gt;windowToScreen(rect);
+}
+
</ins><span class="cx"> void Chrome::setWindowRect(const FloatRect&amp; rect) const
</span><span class="cx"> {
</span><span class="cx">     m_client-&gt;setWindowRect(rect);
</span></span></pre></div>
<a id="trunkWebCorepageChromeh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/Chrome.h (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/Chrome.h        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebCore/page/Chrome.h        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -54,7 +54,9 @@
</span><span class="cx"> 
</span><span class="cx">         // HostWindow methods.
</span><span class="cx">         virtual void repaint(const IntRect&amp;, bool contentChanged, bool immediate = false);
</span><del>-
</del><ins>+        virtual IntPoint screenToWindow(const IntPoint&amp;) const;
+        virtual IntRect windowToScreen(const IntRect&amp;) const;
+    
</ins><span class="cx">         void setWindowRect(const FloatRect&amp;) const;
</span><span class="cx">         FloatRect windowRect() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/ChromeClient.h (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/ChromeClient.h        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebCore/page/ChromeClient.h        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -116,7 +116,11 @@
</span><span class="cx">         virtual void updateBackingStore() = 0;
</span><span class="cx">         // End deprecated methods.
</span><span class="cx"> 
</span><ins>+        // Methods used by HostWindow.
</ins><span class="cx">         virtual void repaint(const IntRect&amp;, bool contentChanged, bool immediate = false) = 0;
</span><ins>+        virtual IntPoint screenToWindow(const IntPoint&amp;) const = 0;
+        virtual IntRect windowToScreen(const IntRect&amp;) const = 0;
+        // End methods used by HostWindow.
</ins><span class="cx"> 
</span><span class="cx">         virtual void mouseDidMoveOverElement(const HitTestResult&amp;, unsigned modifierFlags) = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoreplatformHostWindowh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/HostWindow.h (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/HostWindow.h        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebCore/platform/HostWindow.h        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class IntPoint;
</ins><span class="cx"> class IntRect;
</span><span class="cx"> 
</span><span class="cx"> class HostWindow : Noncopyable {
</span><span class="lines">@@ -45,6 +46,10 @@
</span><span class="cx"> 
</span><span class="cx">     // The paint method just causes a synchronous update of the window to happen for platforms that need it (Windows).
</span><span class="cx">     void paint() { repaint(IntRect(), false, true); }
</span><ins>+    
+    // Methods for doing coordinate conversions to and from screen coordinates.
+    virtual IntPoint screenToWindow(const IntPoint&amp;) const = 0;
+    virtual IntRect windowToScreen(const IntRect&amp;) const = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCoreplatformScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/ScrollView.cpp (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/ScrollView.cpp        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebCore/platform/ScrollView.cpp        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -222,6 +222,20 @@
</span><span class="cx">     return convertToContainingWindow(viewRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntRect ScrollView::contentsToScreen(const IntRect&amp; rect) const
+{
+    if (platformWidget())
+        return platformContentsToScreen(rect);
+    return hostWindow()-&gt;windowToScreen(contentsToWindow(rect));
+}
+
+IntPoint ScrollView::screenToContents(const IntPoint&amp; point) const
+{
+    if (platformWidget())
+        return platformScreenToContents(point);
+    return windowToContents(hostWindow()-&gt;screenToWindow(point));
+}
+
</ins><span class="cx"> bool ScrollView::containsScrollbarsAvoidingResizer() const
</span><span class="cx"> {
</span><span class="cx">     return !m_scrollbarsAvoidingResizer;
</span><span class="lines">@@ -480,6 +494,16 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntRect ScrollView::platformContentsToScreen(const IntRect&amp; rect) const
+{
+    return rect;
+}
+
+IntPoint ScrollView::platformScreenToContents(const IntPoint&amp; point) const
+{
+    return point;
+}
+
</ins><span class="cx"> void ScrollView::platformSetScrollPosition(const IntPoint&amp;)
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebCoreplatformScrollViewh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/ScrollView.h (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/ScrollView.h        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebCore/platform/ScrollView.h        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -139,6 +139,10 @@
</span><span class="cx">     IntRect windowToContents(const IntRect&amp;) const;
</span><span class="cx">     IntRect contentsToWindow(const IntRect&amp;) const;
</span><span class="cx"> 
</span><ins>+    // Methods for converting to and from screen coordinates.
+    IntRect contentsToScreen(const IntRect&amp;) const;
+    IntPoint screenToContents(const IntPoint&amp;) const;
+
</ins><span class="cx">     // The purpose of this method is to answer whether or not the scroll view is currently visible.  Animations and painting updates can be suspended if
</span><span class="cx">     // we know that we are either not in a window right now or if that window is not visible.
</span><span class="cx">     bool isOffscreen() const;
</span><span class="lines">@@ -182,11 +186,7 @@
</span><span class="cx">         return newPoint;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if HAVE(ACCESSIBILITY)
-    IntRect contentsToScreen(const IntRect&amp;) const;
-    IntPoint screenToContents(const IntPoint&amp;) const;
-#endif
-
</del><ins>+    // Widget override.  Handles painting of the contents of the view as well as the scrollbars.
</ins><span class="cx">     virtual void paint(GraphicsContext*, const IntRect&amp;);
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="lines">@@ -223,6 +223,8 @@
</span><span class="cx">     IntRect platformVisibleContentRect(bool includeScrollbars) const;
</span><span class="cx">     IntSize platformContentsSize() const;
</span><span class="cx">     void platformSetContentsSize();
</span><ins>+    IntRect platformContentsToScreen(const IntRect&amp;) const;
+    IntPoint platformScreenToContents(const IntPoint&amp;) const;
</ins><span class="cx">     void platformSetScrollPosition(const IntPoint&amp;);
</span><span class="cx">     bool platformScroll(ScrollDirection, ScrollGranularity);
</span><span class="cx">     void platformSetScrollbarsSuppressed(bool repaintOnUnsuppress);
</span></span></pre></div>
<a id="trunkWebCoreplatformmacScrollViewMacmm"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/mac/ScrollViewMac.mm (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/mac/ScrollViewMac.mm        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebCore/platform/mac/ScrollViewMac.mm        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx"> 
</span><span class="cx"> // &quot;Containing Window&quot; means the NSWindow's coord system, which is origin lower left
</span><span class="cx"> 
</span><del>-IntRect ScrollView::contentsToScreen(const IntRect&amp; rect) const
</del><ins>+IntRect ScrollView::platformContentsToScreen(const IntRect&amp; rect) const
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx">     if (NSView* documentView = this-&gt;documentView()) {
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx">     return IntRect();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint ScrollView::screenToContents(const IntPoint&amp; point) const
</del><ins>+IntPoint ScrollView::platformScreenToContents(const IntPoint&amp; point) const
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx">     if (NSView* documentView = this-&gt;documentView()) {
</span></span></pre></div>
<a id="trunkWebCoreplatformwinScrollViewWincpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/win/ScrollViewWin.cpp (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/win/ScrollViewWin.cpp        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebCore/platform/win/ScrollViewWin.cpp        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -433,26 +433,4 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntRect ScrollView::contentsToScreen(const IntRect&amp; rect) const
-{
-    IntRect result(contentsToWindow(rect));
-    POINT topLeft = {0, 0};
-
-    // Find the top left corner of the Widget's containing window in screen coords,
-    // and adjust the result rect's position by this amount.
-    ::ClientToScreen(containingWindow(), &amp;topLeft);
-    result.move(topLeft.x, topLeft.y);
-
-    return result;
-}
-
-IntPoint ScrollView::screenToContents(const IntPoint&amp; point) const
-{
-    POINT result = point;
-
-    ::ScreenToClient(containingWindow(), &amp;result);
-
-    return windowToContents(result);
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebKitgtkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/ChangeLog (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/ChangeLog        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/gtk/ChangeLog        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;
+
+        https://bugs.webkit.org/show_bug.cgi?id=21282
+        
+        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
+        
+        Reviewed by Adam Roben
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::windowToScreen):
+        (WebKit::ChromeClient::screenToWindow):
+        * WebCoreSupport/ChromeClientGtk.h:
+
</ins><span class="cx"> 2008-09-30  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         http://bugs.webkit.org/show_bug.cgi?id=21250
</span></span></pre></div>
<a id="trunkWebKitgtkWebCoreSupportChromeClientGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -276,6 +276,18 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntRect ChromeClient::windowToScreen(const IntRect&amp; rect) const
+{
+    notImplemented();
+    return rect;
+}
+
+IntPoint ChromeClient::screenToWindow(const IntPoint&amp; point) const
+{
+    notImplemented();
+    return point;
+}
+
</ins><span class="cx"> void ChromeClient::addToDirtyRegion(const IntRect&amp;)
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span></span></pre></div>
<a id="trunkWebKitgtkWebCoreSupportChromeClientGtkh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -88,6 +88,8 @@
</span><span class="cx">         virtual void updateBackingStore();
</span><span class="cx"> 
</span><span class="cx">         virtual void repaint(const WebCore::IntRect&amp;, bool contentChanged, bool immediate = false);
</span><ins>+        virtual IntPoint screenToWindow(const WebCore::IntPoint&amp;) const;
+        virtual IntRect windowToScreen(const WebCore::IntRect&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">         virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&amp;, unsigned modifierFlags);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/mac/ChangeLog        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;
+
+        https://bugs.webkit.org/show_bug.cgi?id=21282
+        
+        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
+        
+        Reviewed by Adam Roben
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::repaint):
+        (WebChromeClient::screenToWindow):
+        (WebChromeClient::windowToScreen):
+
</ins><span class="cx"> 2008-09-30   Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=21269
</span></span></pre></div>
<a id="trunkWebKitmacWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -93,6 +93,8 @@
</span><span class="cx">     virtual void updateBackingStore();
</span><span class="cx">     
</span><span class="cx">     virtual void repaint(const WebCore::IntRect&amp;, bool contentChanged, bool immediate = false);
</span><ins>+    virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&amp;) const;
+    virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     virtual void setStatusbarText(const WebCore::String&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitmacWebCoreSupportWebChromeClientmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -403,10 +403,22 @@
</span><span class="cx">     return enclosingIntRect([[m_webView window] _growBoxRect]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebChromeClient::repaint(const WebCore::IntRect&amp;, bool, bool)
</del><ins>+// Host window methods are really only needed once we have a viewless Mac Webkit.
+void WebChromeClient::repaint(const IntRect&amp;, bool, bool)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntPoint WebChromeClient::screenToWindow(const IntPoint&amp; p) const
+{
+    return p;
+}
+
+IntRect WebChromeClient::windowToScreen(const IntRect&amp; r) const
+{
+    return r;
+}
+// End host window methods.
+
</ins><span class="cx"> void WebChromeClient::addToDirtyRegion(const IntRect&amp;)
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebKitqtChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/qt/ChangeLog (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/qt/ChangeLog        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/qt/ChangeLog        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;
+        
+        https://bugs.webkit.org/show_bug.cgi?id=21282
+        
+        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
+        
+        Reviewed by Adam Roben
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::windowToScreen):
+        (WebCore::ChromeClientQt::screenToWindow):
+        * WebCoreSupport/ChromeClientQt.h:
+
</ins><span class="cx"> 2008-09-30  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         http://bugs.webkit.org/show_bug.cgi?id=21250
</span></span></pre></div>
<a id="trunkWebKitqtWebCoreSupportChromeClientQtcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -296,7 +296,7 @@
</span><span class="cx">     return IntRect();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ChromeClientQt::repaint(const WebCore::IntRect&amp; windowRect, bool contentChanged, bool)
</del><ins>+void ChromeClientQt::repaint(const IntRect&amp; windowRect, bool contentChanged, bool)
</ins><span class="cx"> {
</span><span class="cx">     // No double buffer, so only update the QWidget if content changed.
</span><span class="cx">     if (contentChanged) {
</span><span class="lines">@@ -314,6 +314,18 @@
</span><span class="cx">     // is set.
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntRect ChromeClientQt::windowToScreen(const IntRect&amp; rect) const
+{
+    notImplemented();
+    return rect;
+}
+
+IntPoint ChromeClientQt::screenToWindow(const IntPoint&amp; point) const
+{
+    notImplemented();
+    return point;
+}
+
</ins><span class="cx"> void ChromeClientQt::addToDirtyRegion(const IntRect&amp; r)
</span><span class="cx"> {
</span><span class="cx">     QWidget* view = m_webPage-&gt;view();
</span></span></pre></div>
<a id="trunkWebKitqtWebCoreSupportChromeClientQth"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -104,7 +104,9 @@
</span><span class="cx">         virtual void updateBackingStore();
</span><span class="cx"> 
</span><span class="cx">         virtual void repaint(const IntRect&amp;, bool contentChanged, bool immediate = false);
</span><del>-
</del><ins>+        virtual IntPoint screenToWindow(const IntPoint&amp;) const;
+        virtual IntRect windowToScreen(const IntRect&amp;) const;
+    
</ins><span class="cx">         virtual void mouseDidMoveOverElement(const HitTestResult&amp;, unsigned modifierFlags);
</span><span class="cx"> 
</span><span class="cx">         virtual void setToolTip(const String&amp;);
</span></span></pre></div>
<a id="trunkWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/ChangeLog (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/ChangeLog        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/win/ChangeLog        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;
+        
+        https://bugs.webkit.org/show_bug.cgi?id=21282
+        
+        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
+        
+        Reviewed by Adam Roben
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::windowToScreen):
+        (WebChromeClient::screenToWindow):
+        * WebCoreSupport/WebChromeClient.h:
+
</ins><span class="cx"> 2008-09-30   Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=21269
</span></span></pre></div>
<a id="trunkWebKitwinWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/WebCoreSupport/WebChromeClient.cpp (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/WebCoreSupport/WebChromeClient.cpp        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/win/WebCoreSupport/WebChromeClient.cpp        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -423,6 +423,35 @@
</span><span class="cx">     m_webView-&gt;repaint(windowRect, contentChanged, immediate);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntRect WebChromeClient::windowToScreen(const IntRect&amp; rect) const
+{
+    HWND viewWindow;
+    if (FAILED(m_webView-&gt;viewWindow(reinterpret_cast&lt;OLE_HANDLE*&gt;(&amp;viewWindow))))
+        return rect;
+
+    // Find the top left corner of the Widget's containing window in screen coords,
+    // and adjust the result rect's position by this amount.
+    POINT topLeft = {0, 0};
+    IntRect result = rect;
+    ::ClientToScreen(viewWindow, &amp;topLeft);
+    result.move(topLeft.x, topLeft.y);
+
+    return result;
+}
+
+IntPoint WebChromeClient::screenToWindow(const IntPoint&amp; point) const
+{
+    POINT result = point;
+
+    HWND viewWindow;
+    if (FAILED(webView-&gt;viewWindow(reinterpret_cast&lt;OLE_HANDLE*&gt;(&amp;viewWindow))))
+        return point;
+
+    ::ScreenToClient(viewWindow, &amp;result);
+
+    return result;
+}
+
</ins><span class="cx"> void WebChromeClient::addToDirtyRegion(const IntRect&amp; dirtyRect)
</span><span class="cx"> {
</span><span class="cx">     m_webView-&gt;addToDirtyRegion(dirtyRect);
</span></span></pre></div>
<a id="trunkWebKitwinWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/WebCoreSupport/WebChromeClient.h (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/WebCoreSupport/WebChromeClient.h        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/win/WebCoreSupport/WebChromeClient.h        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -93,6 +93,8 @@
</span><span class="cx">     virtual WebCore::IntRect windowResizerRect() const;
</span><span class="cx"> 
</span><span class="cx">     virtual void repaint(const WebCore::IntRect&amp;, bool contentChanged, bool immediate = false);
</span><ins>+    virtual IntPoint screenToWindow(const IntPoint&amp; p) const;
+    virtual IntRect windowToScreen(const IntRect&amp; r) const;
</ins><span class="cx"> 
</span><span class="cx">     virtual void addToDirtyRegion(const WebCore::IntRect&amp;);
</span><span class="cx">     virtual void scrollBackingStore(int dx, int dy, const WebCore::IntRect&amp; scrollViewRect, const WebCore::IntRect&amp; clipRect);
</span></span></pre></div>
<a id="trunkWebKitwxChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/wx/ChangeLog (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/wx/ChangeLog        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/wx/ChangeLog        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2008-10-01  David Hyatt  &lt;hyatt@apple.com&gt;
+
+        https://bugs.webkit.org/show_bug.cgi?id=21282
+        
+        Make contentsToScreen/screenToContents cross-platform.  Only implemented by Mac/Win right now.
+    
+        Reviewed by Adam Roben
+
+        * WebKitSupport/ChromeClientWx.cpp:
+        (WebCore::ChromeClientWx::windowToScreen):
+        (WebCore::ChromeClientWx::screenToWindow):
+        * WebKitSupport/ChromeClientWx.h:
+
</ins><span class="cx"> 2008-09-30  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         http://bugs.webkit.org/show_bug.cgi?id=21250
</span></span></pre></div>
<a id="trunkWebKitwxWebKitSupportChromeClientWxcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/wx/WebKitSupport/ChromeClientWx.cpp (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/wx/WebKitSupport/ChromeClientWx.cpp        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/wx/WebKitSupport/ChromeClientWx.cpp        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -288,6 +288,18 @@
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntRect ChromeClientWx::windowToScreen(const IntRect&amp; rect) const
+{
+    notImplemented();
+    return rect;
+}
+
+IntPoint ChromeClientWx::screenToWindow(const IntPoint&amp; point) const
+{
+    notImplemented();
+    return point;
+}
+
</ins><span class="cx"> void ChromeClientWx::addToDirtyRegion(const IntRect&amp;)
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span></span></pre></div>
<a id="trunkWebKitwxWebKitSupportChromeClientWxh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/wx/WebKitSupport/ChromeClientWx.h (37152 => 37153)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/wx/WebKitSupport/ChromeClientWx.h        2008-10-01 20:31:19 UTC (rev 37152)
+++ trunk/WebKit/wx/WebKitSupport/ChromeClientWx.h        2008-10-01 20:34:07 UTC (rev 37153)
</span><span class="lines">@@ -99,6 +99,8 @@
</span><span class="cx">     virtual void updateBackingStore();
</span><span class="cx">     
</span><span class="cx">     virtual void repaint(const IntRect&amp;, bool contentChanged, bool immediate = false);
</span><ins>+    virtual IntPoint screenToWindow(const IntPoint&amp;) const;
+    virtual IntRect windowToScreen(const IntRect&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     virtual void mouseDidMoveOverElement(const HitTestResult&amp;, unsigned modifierFlags);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>