Bug 7686 - Scrollbars render improperly when resized
Summary: Scrollbars render improperly when resized
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 417.x
Hardware: PC OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-09 15:47 PST by Brian Sweet
Modified: 2013-06-05 10:55 PDT (History)
3 users (show)

See Also:


Attachments
Test showing incorrect scrollbar render when resized (1.25 KB, text/html)
2006-03-09 15:48 PST, Brian Sweet
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Sweet 2006-03-09 15:47:49 PST
The attached demonstration can be used to view this problem.  Please note that I'm using the scrollbar setting that places both the arrows on the same side of the scrollbar.

The attached demonstration has an onscroll event that prints out the scrollLeft position of the overscroll:auto div to the screen.  It also has links that allow you to increase & decrease the size of the div.  Here are the steps to repeat the problem:

1) Load the page.
2) Scroll the scrollbar all the way over to the right.  The last logged scrollLeft should be "800"
3) Click the "ENLARGE" link.  This increases the size of the scrollbar by 50
4) Note that the onscroll event logs that scrollLeft is now "750".  This is because the scrollbar resized and "all the way to the right" is now at position "750".
5) Note also though that the scrollbar that appears on the screen is not all the way to the right.  Instead it looks like there is room to scroll the scrollbar further to the right.
6) Try clicking the "right" button.  It will not scroll -- it thinks it's all the way to the right
7) Try dragging the scrollbar to the right.  You can indeed scroll it further to the right.  The onscroll events seem to indicate that the actual scrollbar position was 700 (even though scrollLeft said 750).

So, in summary, when a scrollbar is resized, the onscroll event returns the correct new scrollLeft position, but the actual rendered scrollbar is at a different position.  (By "correct" I'm assuming you intended the scrollbar to stay all the way to the right.  It could be that the real scrollbar is correct and the scrollLeft position is wrong, but either way they are not the same).

This causes the position indicated by the scrollbar and the position indicated by scrollLeft to be different.  The only way to fix it is to actually scroll the scrollbar, at which point the two will move back in sync.
Comment 1 Brian Sweet 2006-03-09 15:48:25 PST
Created attachment 6967 [details]
Test showing incorrect scrollbar render when resized
Comment 2 Brian Sweet 2006-03-09 15:51:03 PST
Decided to move this to Javascript, since perhaps the scrollbar is correct and the javascript code is returning the wrong scrollLeft value.
Comment 3 Robert Hogan 2013-06-04 10:53:40 PDT
This is no longer happening. Checked on Chrome 27 with WebKit r147273.

Please reopen if you disagree!
Comment 4 Alexey Proskuryakov 2013-06-05 10:55:20 PDT
Difficult to test on Mac, as scroll bar behavior is all different now.