<!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>[42297] 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/42297">42297</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2009-04-07 16:09:14 -0700 (Tue, 07 Apr 2009)</dd>
</dl>

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

2009-04-07  David Hyatt  &lt;hyatt@apple.com&gt;

        Reviewed by Adam Roben

        Fix ScrollView's algorithm that determines whether or not to show scrollbars.  There was a bug
        with the method mainly because RenderView will size itself to the viewport's size, making it
        impossible to really know the document's &quot;true&quot; size.

        In order to solve this problem ScrollView now has a minimumContentsSize method.  This method
        returns the document size excluding the RenderView from the calculation.  This width/height
        is now cached on RenderView in m_docWidth/m_docHeight member variables.

        * WebCore.base.exp:
        * page/FrameView.cpp:
        (WebCore::FrameView::adjustPageHeight):
        (WebCore::FrameView::minimumContentsSize):
        * page/FrameView.h:
        * platform/ScrollView.cpp:
        (WebCore::ScrollView::updateScrollbars):
        * platform/ScrollView.h:
        (WebCore::ScrollView::minimumContentsSize):
        * rendering/RenderView.cpp:
        (WebCore::RenderView::layout):
        (WebCore::RenderView::calcDocHeight):
        (WebCore::RenderView::calcDocWidth):
        * rendering/RenderView.h:
        (WebCore::RenderView::docWidth):
        (WebCore::RenderView::docHeight):

WebKit/mac:

2009-04-07  David Hyatt  &lt;hyatt@apple.com&gt;

        Reviewed by Adam Roben

        Mac portion of fix to make DumpRenderTree always produce accurate scrollbar results.  Change
        updateScrollers to call minimumContentsSize when a WebHTMLView is inside the WebDynamicScrollbarsView.

        * WebView/WebDynamicScrollBarsView.m:
        (-[WebDynamicScrollBarsView updateScrollers]):

LayoutTests:

2009-04-07  David Hyatt  &lt;hyatt@apple.com&gt;

        Reviewed by Adam Roben

        Land updated layout test results now that DRT is doing the right thing
        with scrollbar results.

        * platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.checksum:
        * platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.png:
        * platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.txt:
        * platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.checksum:
        * platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.png:
        * platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.txt:
        * platform/mac/fast/block/float/013-expected.checksum:
        * platform/mac/fast/block/float/013-expected.png:
        * platform/mac/fast/block/float/013-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss21t0803c5502mrgnr02cexpectedchecksum">trunk/LayoutTests/platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.checksum</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss21t0803c5502mrgnr02cexpectedpng">trunk/LayoutTests/platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss21t0803c5502mrgnr02cexpectedtxt">trunk/LayoutTests/platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss21t0803c5505mrgn02cexpectedchecksum">trunk/LayoutTests/platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.checksum</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss21t0803c5505mrgn02cexpectedpng">trunk/LayoutTests/platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss21t0803c5505mrgn02cexpectedtxt">trunk/LayoutTests/platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastblockfloat013expectedchecksum">trunk/LayoutTests/platform/mac/fast/block/float/013-expected.checksum</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastblockfloat013expectedpng">trunk/LayoutTests/platform/mac/fast/block/float/013-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastblockfloat013expectedtxt">trunk/LayoutTests/platform/mac/fast/block/float/013-expected.txt</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreWebCorebaseexp">trunk/WebCore/WebCore.base.exp</a></li>
<li><a href="#trunkWebCorepageFrameViewcpp">trunk/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkWebCorepageFrameViewh">trunk/WebCore/page/FrameView.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="#trunkWebCorerenderingRenderViewcpp">trunk/WebCore/rendering/RenderView.cpp</a></li>
<li><a href="#trunkWebCorerenderingRenderViewh">trunk/WebCore/rendering/RenderView.h</a></li>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacWebViewWebDynamicScrollBarsViewm">trunk/WebKit/mac/WebView/WebDynamicScrollBarsView.m</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/LayoutTests/ChangeLog        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2009-04-07  David Hyatt  &lt;hyatt@apple.com&gt;
+
+        Reviewed by Adam Roben
+
+        Land updated layout test results now that DRT is doing the right thing
+        with scrollbar results.
+
+        * platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.checksum:
+        * platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.png:
+        * platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.txt:
+        * platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.checksum:
+        * platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.png:
+        * platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.txt:
+        * platform/mac/fast/block/float/013-expected.checksum:
+        * platform/mac/fast/block/float/013-expected.png:
+        * platform/mac/fast/block/float/013-expected.txt:
+
</ins><span class="cx"> 2009-04-07  Brian Weinstein  &lt;bweinstein@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Adler.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss21t0803c5502mrgnr02cexpectedchecksum"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.checksum (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.checksum        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/LayoutTests/platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.checksum        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -1 +1 @@
</span><del>-63eaff280f1a5667c3feaa9b980c9eb3
</del><span class="cx">\ No newline at end of file
</span><ins>+d1e6e39e61dd10446c07f309f4c6fbfb
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss21t0803c5502mrgnr02cexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss21t0803c5502mrgnr02cexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.txt (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.txt        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/LayoutTests/platform/mac/css2.1/t0803-c5502-mrgn-r-02-c-expected.txt        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><del>-layer at (0,0) size 802x600
-  RenderView at (0,0) size 800x600
</del><ins>+layer at (0,0) size 802x585
+  RenderView at (0,0) size 800x585
</ins><span class="cx"> layer at (0,0) size 802x66
</span><span class="cx">   RenderBlock {HTML} at (0,0) size 800x66
</span><span class="cx">     RenderBody {BODY} at (8,24) size 784x18
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss21t0803c5505mrgn02cexpectedchecksum"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.checksum (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.checksum        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/LayoutTests/platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.checksum        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -1 +1 @@
</span><del>-43a4729c4ea26a2b126fa2af993d346f
</del><span class="cx">\ No newline at end of file
</span><ins>+553336b9dd74f1d2a8124226a77664b7
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss21t0803c5505mrgn02cexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss21t0803c5505mrgn02cexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.txt (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.txt        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/LayoutTests/platform/mac/css2.1/t0803-c5505-mrgn-02-c-expected.txt        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><del>-layer at (0,0) size 802x600
-  RenderView at (0,0) size 800x600
</del><ins>+layer at (0,0) size 802x585
+  RenderView at (0,0) size 800x585
</ins><span class="cx"> layer at (0,0) size 802x34
</span><span class="cx">   RenderBlock {HTML} at (0,0) size 800x32
</span><span class="cx">     RenderBody {BODY} at (8,-2) size 784x36
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastblockfloat013expectedchecksum"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/block/float/013-expected.checksum (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/block/float/013-expected.checksum        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/LayoutTests/platform/mac/fast/block/float/013-expected.checksum        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -1 +1 @@
</span><del>-03d4b406d734a806ba0d6e57d9e2b508
</del><span class="cx">\ No newline at end of file
</span><ins>+ecdad59c884a27f63ce9e076e5cc1396
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastblockfloat013expectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/fast/block/float/013-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastblockfloat013expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/block/float/013-expected.txt (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/block/float/013-expected.txt        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/LayoutTests/platform/mac/fast/block/float/013-expected.txt        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><del>-layer at (0,0) size 808x600
-  RenderView at (0,0) size 800x600
</del><ins>+layer at (0,0) size 808x585
+  RenderView at (0,0) size 800x585
</ins><span class="cx"> layer at (0,0) size 800x8
</span><span class="cx">   RenderBlock {HTML} at (0,0) size 800x8
</span><span class="cx">     RenderBody {BODY} at (8,8) size 784x0
</span></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/WebCore/ChangeLog        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2009-04-07  David Hyatt  &lt;hyatt@apple.com&gt;
+
+        Reviewed by Adam Roben
+
+        Fix ScrollView's algorithm that determines whether or not to show scrollbars.  There was a bug
+        with the method mainly because RenderView will size itself to the viewport's size, making it
+        impossible to really know the document's &quot;true&quot; size.
+
+        In order to solve this problem ScrollView now has a minimumContentsSize method.  This method
+        returns the document size excluding the RenderView from the calculation.  This width/height
+        is now cached on RenderView in m_docWidth/m_docHeight member variables.
+
+        * WebCore.base.exp:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::adjustPageHeight):
+        (WebCore::FrameView::minimumContentsSize):
+        * page/FrameView.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::updateScrollbars):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::minimumContentsSize):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::layout):
+        (WebCore::RenderView::calcDocHeight):
+        (WebCore::RenderView::calcDocWidth):
+        * rendering/RenderView.h:
+        (WebCore::RenderView::docWidth):
+        (WebCore::RenderView::docHeight):
+
</ins><span class="cx"> 2009-04-07  Dimitri Glazkov  &lt;dglazkov@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Build fix, not reviewed.
</span></span></pre></div>
<a id="trunkWebCoreWebCorebaseexp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.base.exp (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.base.exp        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/WebCore/WebCore.base.exp        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -572,6 +572,7 @@
</span><span class="cx"> __ZN7WebCore7Console21shouldPrintExceptionsEv
</span><span class="cx"> __ZN7WebCore7Console24setShouldPrintExceptionsEb
</span><span class="cx"> __ZN7WebCore7IntSizeC1ERK7_NSSize
</span><ins>+__ZNK7WebCore7IntSizecv7_NSSizeEv
</ins><span class="cx"> __ZN7WebCore7cookiesEPKNS_8DocumentERKNS_4KURLE
</span><span class="cx"> __ZN7WebCore7nsColorERKNS_5ColorE
</span><span class="cx"> __ZN7WebCore8Document11createRangeEv
</span></span></pre></div>
<a id="trunkWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/FrameView.cpp (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/FrameView.cpp        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/WebCore/page/FrameView.cpp        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -1448,4 +1448,12 @@
</span><span class="cx">         *newBottom = oldBottom;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntSize FrameView::minimumContentsSize() const
+{
+    RenderView* root = m_frame-&gt;contentRenderer();
+    if (!root)
+        return ScrollView::minimumContentsSize();
+    return IntSize(root-&gt;docWidth(), root-&gt;docHeight());
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/FrameView.h (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/FrameView.h        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/WebCore/page/FrameView.h        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -73,6 +73,8 @@
</span><span class="cx">     void setMarginWidth(int);
</span><span class="cx">     void setMarginHeight(int);
</span><span class="cx"> 
</span><ins>+    virtual IntSize minimumContentsSize() const;
+
</ins><span class="cx">     virtual void setCanHaveScrollbars(bool);
</span><span class="cx"> 
</span><span class="cx">     virtual PassRefPtr&lt;Scrollbar&gt; createScrollbar(ScrollbarOrientation);
</span></span></pre></div>
<a id="trunkWebCoreplatformScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/ScrollView.cpp (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/ScrollView.cpp        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/WebCore/platform/ScrollView.cpp        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -339,13 +339,15 @@
</span><span class="cx">             if (hasVerticalScrollbar != oldHasVertical || hasHorizontalScrollbar != oldHasHorizontal)
</span><span class="cx">                 visibleContentsResized();
</span><span class="cx"> 
</span><del>-            scrollsVertically = (vScroll == ScrollbarAlwaysOn) || (vScroll == ScrollbarAuto &amp;&amp; contentsHeight() &gt; height());
</del><ins>+            IntSize docSize = minimumContentsSize();
+
+            scrollsVertically = (vScroll == ScrollbarAlwaysOn) || (vScroll == ScrollbarAuto &amp;&amp; docSize.height() &gt; height());
</ins><span class="cx">             if (scrollsVertically)
</span><del>-                scrollsHorizontally = (hScroll == ScrollbarAlwaysOn) || (hScroll == ScrollbarAuto &amp;&amp; contentsWidth() + scrollbarThickness &gt; width());
</del><ins>+                scrollsHorizontally = (hScroll == ScrollbarAlwaysOn) || (hScroll == ScrollbarAuto &amp;&amp; docSize.width() + scrollbarThickness &gt; width());
</ins><span class="cx">             else {
</span><del>-                scrollsHorizontally = (hScroll == ScrollbarAlwaysOn) || (hScroll == ScrollbarAuto &amp;&amp; contentsWidth() &gt; width());
</del><ins>+                scrollsHorizontally = (hScroll == ScrollbarAlwaysOn) || (hScroll == ScrollbarAuto &amp;&amp; docSize.width() &gt; width());
</ins><span class="cx">                 if (scrollsHorizontally)
</span><del>-                    scrollsVertically = (vScroll == ScrollbarAlwaysOn) || (vScroll == ScrollbarAuto &amp;&amp; contentsHeight() + scrollbarThickness &gt; height());
</del><ins>+                    scrollsVertically = (vScroll == ScrollbarAlwaysOn) || (vScroll == ScrollbarAuto &amp;&amp; docSize.height() + scrollbarThickness &gt; height());
</ins><span class="cx">             }
</span><span class="cx">         } else {
</span><span class="cx">             scrollsHorizontally = (hScroll == ScrollbarAuto) ? hasHorizontalScrollbar : (hScroll == ScrollbarAlwaysOn);
</span></span></pre></div>
<a id="trunkWebCoreplatformScrollViewh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/ScrollView.h (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/ScrollView.h        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/WebCore/platform/ScrollView.h        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -125,7 +125,8 @@
</span><span class="cx">     
</span><span class="cx">     // Methods for getting/setting the size of the document contained inside the ScrollView (as an IntSize or as individual width and height
</span><span class="cx">     // values).
</span><del>-    IntSize contentsSize() const;
</del><ins>+    IntSize contentsSize() const; // Always at least as big as the visibleWidth()/visibleHeight().
+    virtual IntSize minimumContentsSize() const { return contentsSize(); } // Allows a subclass to indicate a smaller size than the viewport (used for scrollbar checking).
</ins><span class="cx">     int contentsWidth() const { return contentsSize().width(); }
</span><span class="cx">     int contentsHeight() const { return contentsSize().height(); }
</span><span class="cx">     virtual void setContentsSize(const IntSize&amp;);
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderView.cpp (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderView.cpp        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/WebCore/rendering/RenderView.cpp        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -121,12 +121,11 @@
</span><span class="cx">     if (needsLayout())
</span><span class="cx">         RenderBlock::layout();
</span><span class="cx"> 
</span><del>-    // Ensure that docWidth() &gt;= width() and docHeight() &gt;= height().
-    setOverflowWidth(width());
-    setOverflowHeight(height());
</del><ins>+    m_docWidth = calcDocWidth();
+    m_docHeight = calcDocHeight();
</ins><span class="cx"> 
</span><del>-    setOverflowWidth(docWidth());
-    setOverflowHeight(docHeight());
</del><ins>+    setOverflowWidth(max(width(), m_docWidth));
+    setOverflowHeight(max(height(), m_docHeight));
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(layoutDelta() == IntSize());
</span><span class="cx">     ASSERT(m_layoutStateDisableCount == 0);
</span><span class="lines">@@ -550,12 +549,12 @@
</span><span class="cx">     return IntRect();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int RenderView::docHeight() const
</del><ins>+int RenderView::calcDocHeight() const
</ins><span class="cx"> {
</span><del>-    int h = height();
-    int lowestPos = lowestPosition();
-    if (lowestPos &gt; h)
-        h = lowestPos;
</del><ins>+    // Exclude our own height, since it always matches the viewport height.  We want to know the height
+    // of the document if it is potentially smaller than the viewport (this value will be used when trying
+    // to figure out if scrollbars are needed).
+    int h = max(0, lowestPosition(true, false));
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: This doesn't do any margin collapsing.
</span><span class="cx">     // Instead of this dh computation we should keep the result
</span><span class="lines">@@ -570,13 +569,13 @@
</span><span class="cx">     return h;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int RenderView::docWidth() const
</del><ins>+int RenderView::calcDocWidth() const
</ins><span class="cx"> {
</span><del>-    int w = width();
-    int rightmostPos = rightmostPosition();
-    if (rightmostPos &gt; w)
-        w = rightmostPos;
-    
</del><ins>+    // Exclude our own width, since it always matches the viewport width.  We want to know the width
+    // of the document if it is potentially smaller than the viewport (this value will be used when trying
+    // to figure out if scrollbars are needed).
+    int w = max(0, rightmostPosition(true, false));
+
</ins><span class="cx">     for (RenderBox* c = firstChildBox(); c; c = c-&gt;nextSiblingBox()) {
</span><span class="cx">         int dw = c-&gt;width() + c-&gt;marginLeft() + c-&gt;marginRight();
</span><span class="cx">         if (dw &gt; w)
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderViewh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderView.h (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderView.h        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/WebCore/rendering/RenderView.h        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -50,14 +50,14 @@
</span><span class="cx">     virtual void calcWidth();
</span><span class="cx">     virtual void calcHeight();
</span><span class="cx">     virtual void calcPrefWidths();
</span><del>-    
-    int docHeight() const;
-    int docWidth() const;
</del><span class="cx"> 
</span><span class="cx">     // The same as the FrameView's layoutHeight/layoutWidth but with null check guards.
</span><span class="cx">     int viewHeight() const;
</span><span class="cx">     int viewWidth() const;
</span><span class="cx">     
</span><ins>+    int docWidth() const { return m_docWidth; }
+    int docHeight() const { return m_docHeight; }
+
</ins><span class="cx">     float zoomFactor() const;
</span><span class="cx"> 
</span><span class="cx">     FrameView* frameView() const { return m_frameView; }
</span><span class="lines">@@ -171,6 +171,9 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     bool shouldRepaint(const IntRect&amp; r) const;
</span><ins>+        
+    int calcDocHeight() const;
+    int calcDocWidth() const;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     FrameView* m_frameView;
</span><span class="lines">@@ -192,6 +195,9 @@
</span><span class="cx">     RenderWidgetSet m_widgets;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    int m_docWidth;
+    int m_docHeight;
+
</ins><span class="cx">     int m_bestTruncatedAt;
</span><span class="cx">     int m_truncatorWidth;
</span><span class="cx">     bool m_forcedPageBreak;
</span></span></pre></div>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/WebKit/mac/ChangeLog        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2009-04-07  David Hyatt  &lt;hyatt@apple.com&gt;
+
+        Reviewed by Adam Roben
+
+        Mac portion of fix to make DumpRenderTree always produce accurate scrollbar results.  Change
+        updateScrollers to call minimumContentsSize when a WebHTMLView is inside the WebDynamicScrollbarsView.
+
+        * WebView/WebDynamicScrollBarsView.m:
+        (-[WebDynamicScrollBarsView updateScrollers]):
+
</ins><span class="cx"> 2009-04-07  Gustavo Noronha Silva  &lt;gustavo.noronha@collabora.co.uk&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Anders Carlsson.
</span></span></pre></div>
<a id="trunkWebKitmacWebViewWebDynamicScrollBarsViewm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebView/WebDynamicScrollBarsView.m (42296 => 42297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebView/WebDynamicScrollBarsView.m        2009-04-07 22:56:41 UTC (rev 42296)
+++ trunk/WebKit/mac/WebView/WebDynamicScrollBarsView.m        2009-04-07 23:09:14 UTC (rev 42297)
</span><span class="lines">@@ -29,7 +29,11 @@
</span><span class="cx"> #import &quot;WebDynamicScrollBarsViewInternal.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #import &quot;WebDocument.h&quot;
</span><ins>+#import &quot;WebFrameInternal.h&quot;
</ins><span class="cx"> #import &quot;WebFrameView.h&quot;
</span><ins>+#import &quot;WebHTMLViewInternal.h&quot;
+#import &lt;WebCore/Frame.h&gt;
+#import &lt;WebCore/FrameView.h&gt;
</ins><span class="cx"> #import &lt;WebKitSystemInterface.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -118,6 +122,14 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 NSSize documentSize = [documentView frame].size;
</span><ins>+                if ([documentView isKindOfClass:[WebHTMLView class]]) {
+                    WebHTMLView *htmlView = (WebHTMLView*)documentView;
+                    if (Frame* coreFrame = core([htmlView _frame])) {
+                        if (FrameView* coreView = coreFrame-&gt;view())
+                            documentSize = coreView-&gt;minimumContentsSize();
+                    }
+                }
+
</ins><span class="cx">                 NSSize frameSize = [self frame].size;
</span><span class="cx"> 
</span><span class="cx">                 scrollsVertically = (vScroll == ScrollbarAlwaysOn) ||
</span></span></pre>
</div>
</div>

</body>
</html>