2007-04-26 Mitz Pettel <mitz@webkit.org>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Apr 2007 05:00:58 +0000 (05:00 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Apr 2007 05:00:58 +0000 (05:00 +0000)
        Reviewed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=13500
          REGRESSION: Listbox scrollbar does not reflect actual scrolled position when selected option is added after layout

        Test: fast/forms/listbox-scrollbar-incremental-load.html

        The scroller position was not updated correctly during insertion, since
        scrollbar proportions are updated only during layout

        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::selectionChanged): Delay scrolling to reveal the
        selection until after layout if m_optionsChanged is set. Layout is
        guaranteed to happen soon when the flag is set.

2007-04-26  Mitz Pettel  <mitz@webkit.org>

        Reviewed by Darin.

        - pixel test for http://bugs.webkit.org/show_bug.cgi?id=13500
          REGRESSION: Listbox scrollbar does not reflect actual scrolled position when selected option is added after layout

        * fast/forms/listbox-scrollbar-incremental-load-expected.checksum: Added.
        * fast/forms/listbox-scrollbar-incremental-load-expected.png: Added.
        * fast/forms/listbox-scrollbar-incremental-load-expected.txt: Added.
        * fast/forms/listbox-scrollbar-incremental-load.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@21132 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/forms/listbox-scrollbar-incremental-load-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/listbox-scrollbar-incremental-load-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/listbox-scrollbar-incremental-load-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/listbox-scrollbar-incremental-load.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderListBox.cpp

index 6b4b6d1..b8711fa 100644 (file)
@@ -1,3 +1,15 @@
+2007-04-26  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
+        - pixel test for http://bugs.webkit.org/show_bug.cgi?id=13500
+          REGRESSION: Listbox scrollbar does not reflect actual scrolled position when selected option is added after layout
+
+        * fast/forms/listbox-scrollbar-incremental-load-expected.checksum: Added.
+        * fast/forms/listbox-scrollbar-incremental-load-expected.png: Added.
+        * fast/forms/listbox-scrollbar-incremental-load-expected.txt: Added.
+        * fast/forms/listbox-scrollbar-incremental-load.html: Added.
+
 2007-04-26  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by oliver
diff --git a/LayoutTests/fast/forms/listbox-scrollbar-incremental-load-expected.checksum b/LayoutTests/fast/forms/listbox-scrollbar-incremental-load-expected.checksum
new file mode 100644 (file)
index 0000000..906163f
--- /dev/null
@@ -0,0 +1 @@
+b23794c7812e948ddd2126d5cf5cdce4
\ No newline at end of file
diff --git a/LayoutTests/fast/forms/listbox-scrollbar-incremental-load-expected.png b/LayoutTests/fast/forms/listbox-scrollbar-incremental-load-expected.png
new file mode 100644 (file)
index 0000000..f65cbd1
Binary files /dev/null and b/LayoutTests/fast/forms/listbox-scrollbar-incremental-load-expected.png differ
diff --git a/LayoutTests/fast/forms/listbox-scrollbar-incremental-load-expected.txt b/LayoutTests/fast/forms/listbox-scrollbar-incremental-load-expected.txt
new file mode 100644 (file)
index 0000000..652f2da
--- /dev/null
@@ -0,0 +1,27 @@
+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 767x36
+          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=13500"
+          RenderText {#text} at (354,0) size 767x36
+            text run at (354,0) width 4: " "
+            text run at (358,0) width 409: "REGRESSION: Listbox scrollbar does not reflect actual scrolled"
+            text run at (0,18) width 319: "position when selected option is added after layout"
+        RenderText {#text} at (319,18) size 4x18
+          text run at (319,18) width 4: "."
+      RenderBlock {P} at (0,52) size 784x36
+        RenderText {#text} at (0,0) size 780x36
+          text run at (0,0) width 493: "The list box should be scrolled all the way down, showing the selected option "
+          text run at (493,0) width 287: "\x{201C}Seven\x{201D}. The scroller should be at the bottom"
+          text run at (0,18) width 102: "of the scroll bar "
+          text run at (102,18) width 85: "to reflect this."
+      RenderBlock (anonymous) at (0,104) size 784x61
+        RenderListBox {SELECT} at (2,2) size 48x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/fast/forms/listbox-scrollbar-incremental-load.html b/LayoutTests/fast/forms/listbox-scrollbar-incremental-load.html
new file mode 100644 (file)
index 0000000..d69bcd0
--- /dev/null
@@ -0,0 +1,21 @@
+<p>
+    Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=13500">http://bugs.webkit.org/show_bug.cgi?id=13500</a>
+    REGRESSION: Listbox scrollbar does not reflect actual scrolled position when selected option is added after layout</i>.
+</p>
+<p>
+    The list box should be scrolled all the way down, showing the selected option
+    &ldquo;Seven&rdquo;. The scroller should be at the bottom of the scroll bar
+    to reflect this.
+</p>
+<select size="4">
+    <option>One</option>
+    <option>Two</option>
+    <option>Three</option>
+    <option>Four</option>
+    <script>
+        document.body.offsetTop;
+    </script>
+    <option>Five</option>
+    <option>Six</option>
+    <option selected>Seven</option>
+</select>
index d8fa43e..37869c8 100644 (file)
@@ -1,3 +1,20 @@
+2007-04-26  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=13500
+          REGRESSION: Listbox scrollbar does not reflect actual scrolled position when selected option is added after layout
+
+        Test: fast/forms/listbox-scrollbar-incremental-load.html
+
+        The scroller position was not updated correctly during insertion, since
+        scrollbar proportions are updated only during layout
+
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::selectionChanged): Delay scrolling to reveal the
+        selection until after layout if m_optionsChanged is set. Layout is
+        guaranteed to happen soon when the flag is set.
+
 2007-04-26  David Hyatt  <hyatt@apple.com>
 
         Fix for 13511, crash on a counters page.  Make sure that RenderTexts
index fe53570..9277f2f 100644 (file)
@@ -134,7 +134,7 @@ void RenderListBox::selectionChanged()
 {
     repaint();
     if (!m_inAutoscroll) {
-        if (needsLayout())
+        if (m_optionsChanged || needsLayout())
             m_scrollToRevealSelectionAfterLayout = true;
         else
             scrollToRevealSelection();