Bug 25835 - ScrollTop values reset when parent element toggled
Summary: ScrollTop values reset when parent element toggled
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 312.x
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-16 06:49 PDT by Mårten Björk
Modified: 2011-12-07 16:15 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mårten Björk 2009-05-16 06:49:41 PDT
When parent elements' CSS display value is changed (using JavaScript) to 'none', child nodes' ScrollTop values appear to be reset.
Comment 1 Nickolay 2011-03-23 03:35:52 PDT
This bug is very similar to bug #39284.
Comment 2 Alesandro Ortiz 2011-12-07 16:11:00 PST
I can reproduce this issue in Chrome 15.0.874.121 m on Windows 7 64-bit. Also confirmed in Safari 5.1.1 on Mac OS X 10.7.2. So far I it does not seem platform-specific. This issue does not occur in any recent version of Firefox. Also can reproduce in Internet Explorer 9, so this may be a result of a similar implementation method.

I can post a simplified testcase later this week, but have a live site where the issue can be reproduced.

Steps to reproduce:
1. Load http://www.grovo.com/twitter-ipad-app/twitter-ipad-app-introduction
2. Pause the video once it starts playing (to prevent automatic scrolling behavior which may confuse you while trying to reproduce).
3. Click on the Engage tab (to the right of the video player).
3. Scroll to another position within the now-shown #engagebox-container element.
4. Switch to either the Lessons or Transcript tab (which will hide #engagebox, #engagebox-container's parent).
5. Switch back to the Engage tab (which will set display: block on #engagebox).

Expected results:
The scrollbar's position should be the same as before the element was hidden and shown again. #engagebox-container element's scrollTop value should not be set to 0 every time the parent element is hidden.

Actual results:
The scrollbar's position has been set to the top, as a result of the scrollTop property for #engagebox-container being set to 0.
Comment 3 Alesandro Ortiz 2011-12-07 16:15:39 PST
Nickolay: This does not seem to be caused by the same issue as #39284. I attempted to set the CSS overflow property to hidden and other values on the #engagebox element, and the scrollTop value did not change.