Changeset 91244 in webkit


Ignore:
Timestamp:
Jul 19, 2011 2:21:01 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Patch by Robin Qiu <robin.qiu@torchmobile.com.cn> on 2011-07-19
Reviewed by Antonio Gomes.

ScrollBar should initialize current position in constructor.
https://bugs.webkit.org/show_bug.cgi?id=39284

When ScrollBar is created, m_currentPos should be initialized to
m_scrollableArea's current scrollPosition. Because scrollbars may
be created after the content of m_scrollableArea has been scrolled.

Source/WebCore:

Test: scrollbars/scrollbar-initial-position.html

  • platform/Scrollbar.cpp:

(WebCore::Scrollbar::Scrollbar):

LayoutTests:

  • scrollbars/scrollbar-initial-position-expected.png: Added.
  • scrollbars/scrollbar-initial-position-expected.txt: Added.
  • scrollbars/scrollbar-initial-position.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r91243 r91244  
     12011-07-19  Robin Qiu  <robin.qiu@torchmobile.com.cn>
     2
     3        Reviewed by Antonio Gomes.
     4
     5        ScrollBar should initialize current position in constructor.
     6        https://bugs.webkit.org/show_bug.cgi?id=39284
     7
     8        When ScrollBar is created, m_currentPos should be initialized to
     9        m_scrollableArea's current scrollPosition. Because scrollbars may
     10        be created after the content of m_scrollableArea has been scrolled.
     11
     12        * scrollbars/scrollbar-initial-position-expected.png: Added.
     13        * scrollbars/scrollbar-initial-position-expected.txt: Added.
     14        * scrollbars/scrollbar-initial-position.html: Added.
     15
    1162011-07-19  Yuta Kitamura  <yutak@chromium.org>
    217
  • trunk/Source/WebCore/ChangeLog

    r91243 r91244  
     12011-07-19  Robin Qiu  <robin.qiu@torchmobile.com.cn>
     2
     3        Reviewed by Antonio Gomes.
     4
     5        ScrollBar should initialize current position in constructor.
     6        https://bugs.webkit.org/show_bug.cgi?id=39284
     7
     8        When ScrollBar is created, m_currentPos should be initialized to
     9        m_scrollableArea's current scrollPosition. Because scrollbars may
     10        be created after the content of m_scrollableArea has been scrolled.
     11
     12        Test: scrollbars/scrollbar-initial-position.html
     13
     14        * platform/Scrollbar.cpp:
     15        (WebCore::Scrollbar::Scrollbar):
     16
    1172011-07-19  Yuta Kitamura  <yutak@chromium.org>
    218
  • trunk/Source/WebCore/platform/Scrollbar.cpp

    r91146 r91244  
    9898    int thickness = m_theme->scrollbarThickness(controlSize);
    9999    Widget::setFrameRect(IntRect(0, 0, thickness, thickness));
     100
     101    if (m_scrollableArea)
     102        m_currentPos = static_cast<float>(m_scrollableArea->scrollPosition(this));
    100103}
    101104
Note: See TracChangeset for help on using the changeset viewer.