Changeset 91547 in webkit


Ignore:
Timestamp:
Jul 21, 2011 8:00:52 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

https://bugs.webkit.org/show_bug.cgi?id=60737

ThumbPosition() in ScrollbarTheme should be ceiled before returned.
Otherwise, some topest/leftest content can not be shown by dragging
scrollbar thumb.

Source/WebCore:

Patch by Robin Qiu <robin.qiu.dev@gmail.com> on 2011-07-21
Reviewed by Antonio Gomes.

Test: scrollbars/scrollbar-drag-thumb-with-large-content.html

  • platform/ScrollbarThemeComposite.cpp:

(WebCore::ScrollbarThemeComposite::thumbPosition):

  • platform/qt/ScrollbarThemeQt.cpp:

(WebCore::ScrollbarThemeQt::thumbPosition):

LayoutTests:

Patch by Robin Qiu <robin.qiu.dev@gmail.com> on 2011-07-21
Reviewed by Antonio Gomes.

  • scrollbars/scrollbar-drag-thumb-with-large-content-expected.txt: Added.
  • scrollbars/scrollbar-drag-thumb-with-large-content.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r91545 r91547  
     12011-07-21  Robin Qiu  <robin.qiu.dev@gmail.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=60737
     4
     5        ThumbPosition() in ScrollbarTheme should be ceiled before returned.
     6        Otherwise, some topest/leftest content can not be shown by dragging
     7        scrollbar thumb.
     8
     9        Reviewed by Antonio Gomes.
     10
     11        * scrollbars/scrollbar-drag-thumb-with-large-content-expected.txt: Added.
     12        * scrollbars/scrollbar-drag-thumb-with-large-content.html: Added.
     13
    1142011-07-21  Ryosuke Niwa  <rniwa@webkit.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r91542 r91547  
     12011-07-21  Robin Qiu  <robin.qiu.dev@gmail.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=60737
     4
     5        ThumbPosition() in ScrollbarTheme should be ceiled before returned.
     6        Otherwise, some topest/leftest content can not be shown by dragging
     7        scrollbar thumb.
     8
     9
     10        Reviewed by Antonio Gomes.
     11
     12        Test: scrollbars/scrollbar-drag-thumb-with-large-content.html
     13
     14        * platform/ScrollbarThemeComposite.cpp:
     15        (WebCore::ScrollbarThemeComposite::thumbPosition):
     16        * platform/qt/ScrollbarThemeQt.cpp:
     17        (WebCore::ScrollbarThemeQt::thumbPosition):
     18
    1192011-07-21  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/Source/WebCore/platform/ScrollbarThemeComposite.cpp

    r87989 r91547  
    269269int ScrollbarThemeComposite::thumbPosition(Scrollbar* scrollbar)
    270270{
    271     if (scrollbar->enabled())
    272         return max(0.0f, scrollbar->currentPos()) * (trackLength(scrollbar) - thumbLength(scrollbar)) / (usedTotalSize(scrollbar) - scrollbar->visibleSize());
     271    if (scrollbar->enabled()) {
     272        float pos = max(0.0f, scrollbar->currentPos()) * (trackLength(scrollbar) - thumbLength(scrollbar)) / (usedTotalSize(scrollbar) - scrollbar->visibleSize());
     273        return (pos < 1 && pos > 0) ? 1 : pos;
     274    }
    273275    return 0;
    274276}
  • trunk/Source/WebCore/platform/qt/ScrollbarThemeQt.cpp

    r87767 r91547  
    214214int ScrollbarThemeQt::thumbPosition(Scrollbar* scrollbar)
    215215{
    216     if (scrollbar->enabled())
    217         return (int)((float)scrollbar->currentPos() * (trackLength(scrollbar) - thumbLength(scrollbar)) / scrollbar->maximum());
     216    if (scrollbar->enabled()) {
     217        float pos = (float)scrollbar->currentPos() * (trackLength(scrollbar) - thumbLength(scrollbar)) / scrollbar->maximum();
     218        return (pos < 1 && pos > 0) ? 1 : pos;
     219    }
    218220    return 0;
    219221}
Note: See TracChangeset for help on using the changeset viewer.