Bug 20103

Summary: Scroll bar spacer appears before scroll bar itself (when height it based on liquid elements)
Product: WebKit Reporter: Phillip Sauerbeck <psauerbeck>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Major CC: bdakin, hyatt, psauerbeck
Priority: P2    
Version: 525.x (Safari 3.1)   
Hardware: Mac   
OS: OS X 10.5   
URL: http://pastie.org/236769
Description Flags
Test case for scroll bug
Change in updateScrollers algorithm
hyatt: review-
Test case for scroll bug, placed within iframe none

Description Phillip Sauerbeck 2008-07-18 15:02:11 PDT
When the browser window crops a container that has its dimensions based on liquid elements, a scroll bar spacer appears before the scroll bar itself.  I have produced a sample test case here: http://pastie.org/236769  there is also an associated video that I have uploaded so that you can see the bug in action: http://vimeo.com/1365917 

Many thanks
Comment 1 Phillip Sauerbeck 2008-07-18 15:05:24 PDT
actually, download the video here: http://www.box.net/shared/mqm7b3sw0s 

Comment 2 Phillip Sauerbeck 2008-07-25 12:34:44 PDT
Created attachment 22476 [details]
Test case for scroll bug

there is also a video of this bug in action here: http://vimeo.com/1366292
Comment 3 Arne 2008-08-03 07:06:35 PDT
Created attachment 22624 [details]
Change in updateScrollers algorithm

The current algorithm for calculating if the scrollbars should be shown misbehaves in this case.

The page is constructed such that its height is dependent on its with, so when the window is made smaller, the vertical scrollbar is needed. But with a re-layout, the page shrinks, and the vertical scrollbar is no longer needed. But after this, a re-layout is not made, and white bars show up around the page.

I have written an algorithm that detects these scrollbar on/off loops explicitly, and then uses all scrollbars needed at each point in the loop. It then re-layouts the page. This will show up as unusable scrollbars in some cases, i.e. no blue part. But I believe this is a better solution than the previous algorithm.

Due to this, some testcases have changed their output for me. When I have looked at them, they seem to still be good, but the scrollbar behavior has changed, and therefore their rendertree. On my build they are:
Comment 4 Eric Seidel (no email) 2008-08-04 01:32:34 PDT
Watching the vimeo video makes the bug clear.  I guess Hyatt is probably the first person to ask to comment on a scrollbar bug?
Comment 5 Eric Seidel (no email) 2008-08-04 20:54:52 PDT
Comment on attachment 22624 [details]
Change in updateScrollers algorithm

Assigning to hyatt for comment.  Obviously anyone who feels comfortable with this code should feel welcome to review this.
Comment 6 Dave Hyatt 2008-08-04 21:31:18 PDT
Comment on attachment 22624 [details]
Change in updateScrollers algorithm

A change to this algorithm will require extensive testing.   I can't r+ this without some kind of testing plan / test cases.
Comment 7 Dave Hyatt 2008-08-04 21:43:10 PDT
Also note this algorithm is duplicated on other platforms, so they all need to be changed to be kept in sync.
Comment 8 Eric Seidel (no email) 2008-08-05 00:50:13 PDT
I would encourage you to make a DumpRenderTree compatible test case which shows this bug (a single web page which when loaded shows this bug).  That's probably possible using an iframe sized to a certain size.  The test case should be stand-alone and all the required files should be possible to add to LayoutTests:

More information about writing tests can be found here:

I'm sure that we already have some amount of Scrolling test cases.  Those will be run whenever you use "run-webkit-tests".  Your new test case(s) would also be run by run-webkit-tests when you place them in LayoutTests/
Comment 9 Phillip Sauerbeck 2008-08-06 10:58:20 PDT
Created attachment 22684 [details]
Test case for scroll bug, placed within iframe

As requested, here is a test case that demonstrates the scroll-bar bug on page load (without having to resize the page.

FYI, FF3 has problems with this as well
Comment 10 Phillip Sauerbeck 2008-08-06 11:08:28 PDT
When you access the attachment #22684 [details] (2008-08-06) from the link within comment #9, or from the attachment table the bug does not appear and seems resolved.  Instead, if you save the page source as html and open it fresh, the bug is correctly demonstrated.

go figure.