Changeset 106430 in webkit


Ignore:
Timestamp:
Jan 31, 2012 9:37:49 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

https://bugs.webkit.org/show_bug.cgi?id=76801
Listboxes incorrectly display contents when cleared and then re-populated.

Whenever the number of items in the listbox is less than the size of listbox (number of visible items the listbox can accomodate),
we set the listbox scroll-offset to zero. The scroll-offset of the Scrollbar should also be set to 0 so that when the listbox is re-populated,
scrollbar position and the content inside the listbox are in sync.

Source/WebCore:

Patch by Joe Thomas <joethomas@motorola.com> on 2012-01-31
Reviewed by Andreas Kling.

Tests: fast/forms/listbox-clear-restore.html

  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::computeLogicalHeight): Setting the scroll-offset of the Scrollbar to 0 when scrollbar is not needed.

LayoutTests:

Added test case.

Patch by Joe Thomas <joethomas@motorola.com> on 2012-01-31
Reviewed by Andreas Kling.

  • fast/forms/listbox-clear-restore-expected.html: Added.
  • fast/forms/listbox-clear-restore.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106428 r106430  
     12012-01-31  Joe Thomas  <joethomas@motorola.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=76801
     4        Listboxes incorrectly display contents when cleared and then re-populated.
     5
     6        Whenever the number of items in the listbox is less than the size of listbox (number of visible items the listbox can accomodate),
     7        we set the listbox scroll-offset to zero. The scroll-offset of the Scrollbar should also be set to 0 so that when the listbox is re-populated,
     8        scrollbar position and the content inside the listbox are in sync.
     9
     10        Added test case.
     11
     12        Reviewed by Andreas Kling.
     13
     14        * fast/forms/listbox-clear-restore-expected.html: Added.
     15        * fast/forms/listbox-clear-restore.html: Added.
     16
    1172012-01-31  Yuzo Fujishima  <yuzo@google.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r106427 r106430  
     12012-01-31  Joe Thomas  <joethomas@motorola.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=76801
     4        Listboxes incorrectly display contents when cleared and then re-populated.
     5
     6        Whenever the number of items in the listbox is less than the size of listbox (number of visible items the listbox can accomodate),
     7        we set the listbox scroll-offset to zero. The scroll-offset of the Scrollbar should also be set to 0 so that when the listbox is re-populated,
     8        scrollbar position and the content inside the listbox are in sync.
     9
     10        Reviewed by Andreas Kling.
     11
     12        Tests: fast/forms/listbox-clear-restore.html
     13
     14        * rendering/RenderListBox.cpp:
     15        (WebCore::RenderListBox::computeLogicalHeight): Setting the scroll-offset of the Scrollbar to 0 when scrollbar is not needed.
     16
    1172012-01-31  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    218
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r105006 r106430  
    255255        m_vBar->setSteps(1, max(1, numVisibleItems() - 1), itemHeight);
    256256        m_vBar->setProportion(numVisibleItems(), numItems());
    257         if (!enabled)
     257        if (!enabled) {
     258            scrollToYOffsetWithoutAnimation(0);
    258259            m_indexOffset = 0;
     260        }
    259261    }
    260262}
Note: See TracChangeset for help on using the changeset viewer.