javascript div hide/show in IFRAME using display:block reset scroll

VERIFIED INVALID

Status

()

Firefox
General
VERIFIED INVALID
13 years ago
13 years ago

People

(Reporter: commerce, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3

Executing this Javascript:
document.getElementById('divname').style.display="block";

to show a DIV tag defined by this HTML:
<div id='divname' style="display:none"><table>...</table></div>

Within a scrolling iframe causes the scroll position of that iframe to reset to
the top.  Thus, if one scrolls past the fold and clicks to update a page
element, that element is effectively lost to view.  Using an anchor tag and
'location.hash' to bring clicked element back into view behaves less than
perfectly, as element is not necessarily at the top of the scroll-view when clicked.

Arguably, proper behavior is no scroll reset upon execution of this form of
javascript.


Reproducible: Always

Steps to Reproduce:
1. Define JS to show/hide an in-IFRAME DIV element using style="display:block|none"
2. Render page in Firefox
3. Scroll IFRAME past fold
4. Execute JS on DIV element visible in scrolled IFRAME
Actual Results:  
IFRAME scroll position resets to top

Expected Results:  
No scroll position reset should be performed unless explicitly requested

Comment 1

13 years ago
Can you please attach a testcase?
(Reporter)

Comment 2

13 years ago
In my efforts to create a testcase that won't expose the production page which
spawned the bug, I found that I couldn't reproduce the bug!  And now the
production page works!  I apologize for cluttering inboxes;  this must have been
an HTML error on my part which I unwittingly fixed.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.