LayoutTests:
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Feb 2007 04:20:26 +0000 (04:20 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Feb 2007 04:20:26 +0000 (04:20 +0000)
commit00b6ccab3bf0e11c3121e2230dab8465acbf7ab6
tree605ea99afd60cf135aa1b766e8b19019e078af1d
parent7c4f0041caeb4ac00b051817b9991bd05cce5a0a
LayoutTests:

        Reviewed by Brady.

        Test for http://bugs.webkit.org/show_bug.cgi?id=12480
        <rdar://problem/4971222> REGRESSION (NativeListBox): Deselecting option causes list to jump to top

        * fast/forms/listbox-deselect-scroll-expected.checksum: Added.
        * fast/forms/listbox-deselect-scroll-expected.png: Added.
        * fast/forms/listbox-deselect-scroll-expected.txt: Added.
        * fast/forms/listbox-deselect-scroll.html: Added.

WebCore:

        Reviewed by Brady.

        Fix for http://bugs.webkit.org/show_bug.cgi?id=12480
        <rdar://problem/4971222> REGRESSION (NativeListBox): Deselecting option causes list to jump to top

        Test: fast/forms/listbox-deselect-scroll.html

        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::activeSelectionStartListIndex): Added.  Returns the index for the active selection.  If there is no active selection,
         it returns the first selected index.
        (WebCore::HTMLSelectElement::activeSelectionEndListIndex): Added.  If there is no active selection, it returns the last selected index.
        * html/HTMLSelectElement.h:
        * rendering/RenderListBox.cpp: (WebCore::RenderListBox::scrollToRevealSelection): Instead of using the first and last selected indices,
          use the active selection indices to determine which item to reveal.  This way, when you're selecting with the keyboard, or the mouse,
          no unnecessary scrolling will occur if the end of your active selection is already visible.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/listbox-deselect-scroll-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/listbox-deselect-scroll-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/listbox-deselect-scroll-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/listbox-deselect-scroll.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLSelectElement.cpp
WebCore/html/HTMLSelectElement.h
WebCore/rendering/RenderListBox.cpp