Reviewed by Darin Adler.
- fix http://bugs.webkit.org/show_bug.cgi?id=16426
Divs with overflow:auto: scrollbars not correctly updated when contents change
Test: fast/overflow/scrollbar-position-update.html
* platform/mac/PlatformScrollBarMac.mm:
(WebCore::PlatformScrollbar::updateThumbProportion): Update the
NSScroller's value for the new proportions.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollInfoAfterLayout): Removed unnecessary
repaint(). Scrollbars repaint themselves as needed.
LayoutTests:
Reviewed by Darin Adler.
- test for http://bugs.webkit.org/show_bug.cgi?id=16426
Divs with overflow:auto: scrollbars not correctly updated when contents change
* fast/overflow/scrollbar-position-update.html: Added.
* platform/mac-leopard/fast/overflow: Added.
* platform/mac-leopard/fast/overflow/scrollbar-position-update-expected.checksum: Added.
* platform/mac-leopard/fast/overflow/scrollbar-position-update-expected.png: Added.
* platform/mac/fast/overflow/scrollbar-position-update-expected.txt: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28774
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-12-16 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - test for http://bugs.webkit.org/show_bug.cgi?id=16426
+ Divs with overflow:auto: scrollbars not correctly updated when contents change
+
+ * fast/overflow/scrollbar-position-update.html: Added.
+ * platform/mac-leopard/fast/overflow: Added.
+ * platform/mac-leopard/fast/overflow/scrollbar-position-update-expected.checksum: Added.
+ * platform/mac-leopard/fast/overflow/scrollbar-position-update-expected.png: Added.
+ * platform/mac/fast/overflow/scrollbar-position-update-expected.txt: Added.
+
2007-12-15 Darin Adler <darin@apple.com>
Disabled the smallFonts.svg test, which has been failing for weeks. I heard that Niko
--- /dev/null
+<p>
+ Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=16426">http://bugs.webkit.org/show_bug.cgi?id=16426</a>
+ Divs with overflow:auto: scrollbars not correctly updated when contents change</i>.
+</p>
+<p>
+ The thumb should be in the middle of the scroll bar.
+</p>
+<div id="outer" style="height: 200px; width: 200px; overflow-y: scroll;">
+ <div id="inner" style="height: 400px;">
+ </div>
+</div>
+<script>
+ document.getElementById("outer").scrollTop = 200;
+ document.getElementById("inner").style.height = "600px";
+</script>
--- /dev/null
+c0488d221d6bba16b5042108b390b675
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {P} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 53x18
+ text run at (0,0) width 53: "Test for "
+ RenderInline {I} at (0,0) size 759x36
+ RenderInline {A} at (0,0) size 301x18 [color=#0000EE]
+ RenderText {#text} at (53,0) size 301x18
+ text run at (53,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=16426"
+ RenderText {#text} at (354,0) size 759x36
+ text run at (354,0) width 4: " "
+ text run at (358,0) width 401: "Divs with overflow:auto: scrollbars not correctly updated when"
+ text run at (0,18) width 102: "contents change"
+ RenderText {#text} at (102,18) size 4x18
+ text run at (102,18) width 4: "."
+ RenderBlock {P} at (0,52) size 784x18
+ RenderText {#text} at (0,0) size 326x18
+ text run at (0,0) width 326: "The thumb should be in the middle of the scroll bar."
+layer at (8,94) size 200x200 clip at (8,94) size 185x200 scrollY 200 scrollHeight 600
+ RenderBlock {DIV} at (0,86) size 200x200
+ RenderBlock {DIV} at (0,0) size 185x600
+2007-12-16 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=16426
+ Divs with overflow:auto: scrollbars not correctly updated when contents change
+
+ Test: fast/overflow/scrollbar-position-update.html
+
+ * platform/mac/PlatformScrollBarMac.mm:
+ (WebCore::PlatformScrollbar::updateThumbProportion): Update the
+ NSScroller's value for the new proportions.
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::updateScrollInfoAfterLayout): Removed unnecessary
+ repaint(). Scrollbars repaint themselves as needed.
+
2007-12-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
void PlatformScrollbar::updateThumbProportion()
{
- float val = (float)m_visibleSize/m_totalSize;
+ float val = static_cast<float>(m_visibleSize) / m_totalSize;
BEGIN_BLOCK_OBJC_EXCEPTIONS;
WebCoreScrollBar *bar = (WebCoreScrollBar *)getView();
- if (!(val == [bar knobProportion] || val < 0.0))
- [bar setFloatValue: [bar floatValue] knobProportion: val];
+ if (val != [bar knobProportion] && val >= 0)
+ [bar setFloatValue:static_cast<float>(m_currentPos) / (m_totalSize - m_visibleSize) knobProportion:val];
END_BLOCK_OBJC_EXCEPTIONS;
}
if (pageStep < 0) pageStep = clientHeight;
m_vBar->setSteps(LINE_STEP, pageStep);
m_vBar->setProportion(clientHeight, m_scrollHeight);
- m_object->repaintRectangle(IntRect(m_object->borderLeft() + m_object->clientWidth(),
- m_object->borderTop(), verticalScrollbarWidth(),
- m_object->height() - m_object->borderTop() - m_object->borderBottom()));
}
if (m_object->element() && m_object->document()->hasListenerType(Document::OVERFLOWCHANGED_LISTENER))