Bug 51148 - Overflow: auto failing to account for scrollbars after an element's size is increased
Summary: Overflow: auto failing to account for scrollbars after an element's size is i...
Status: RESOLVED DUPLICATE of bug 71541
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-15 15:56 PST by Mark Kristensson
Modified: 2012-03-30 12:12 PDT (History)
4 users (show)

See Also:


Attachments
Example of a resized element failing to remove unnecessary scrollbars when set to overflow: auto (1002 bytes, text/html)
2010-12-15 15:57 PST, Mark Kristensson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Kristensson 2010-12-15 15:56:31 PST
This is relatively new bug that has cropped up in our application on Safari and Chrome in the last month. I've taken the very complex JS and HTML from our app and reproduced the bug in the attached html page (with some embedded JS). The basic scenario is this:

We render a DIV (absolutely positioned, if that makes any difference) and give it a default size. The contents of that DIV (in this case an image) are loaded dynamically and can vary in size. When we get back the URL of the image, we put that into the DIV in an IMG tag, get its rendered height and width and then reset the size of the DIV to match. There is a lot math involved here because we want to make sure that if the image is too large to fit into the DIVs (which make up a form in our web application) we size the DIV so that it is completely visible on the screen, but the DIV should scroll so that the user can see their entire image. 

In most cases, the image will fit on the screen and there should be no scrollbars because the DIVs size exactly matches the image inside of it.

This works perfectly in FF, IE and was working in the WebKit browsers until recently.

The attached example reproduces the problem and the button implements our current, ugly workaround where we set the overflow: hidden, trigger a reflow and then set overflow: auto again.
Comment 1 Mark Kristensson 2010-12-15 15:57:41 PST
Created attachment 76703 [details]
Example of a resized element failing to remove unnecessary scrollbars when set to overflow: auto
Comment 2 Simon Fraser (smfr) 2012-03-28 12:35:24 PDT
Would be good to know when this regressed. What's the first nightly build that shows the issue?
Comment 3 SravanKumar S(:sravan) 2012-03-30 12:12:34 PDT

*** This bug has been marked as a duplicate of bug 71541 ***