Closed Bug 87251 Opened 24 years ago Closed 23 years ago

Retain document text location after resize

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 35011

People

(Reporter: kjrogers, Assigned: jst)

Details

From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0) BuildID: 2001050515 If a document is maximised, restored or its width is resized then Mozilla will retain the same scroll position. If a document contains paragraphs that word wrap then this will correspond to a different location within the document text. In IE it is possible (using Javascript) to retain the same text location by scrolling to the first element that was visible prior to the resize. However the Mozilla DOM does not seem to have sufficient facilities to achieve this. In Mozilla you can read the current scroll position using window.pageOffsetY. The position of an element can be read using element.offsetY. However there is no onScroll event that would can be used to trigger calculation of the first visible element. Is there a way in Mozilla to retain the same document location when the frame width is changed? Reproducible: Always Steps to Reproduce: 1. Open any page that contains word wrapped text. 2. Scroll half way down the document 3. Change the frame width Actual Results: Mozilla will not retain the same location within the document. It will retain the same scroll position instead.
Don't you really want to hook into onResize() here instead of into onScroll?
I need both the onResize and the onScroll events to maintain the current scrolling position. The onResize event is needed when the document is resized. The onScroll event is needed whenever the document is scrolled so that the location of the first visible element can be recorded.
Isn't this a duplicate of bug 35011 (onScroll not firing as necessary)?
I believe it is, but I discovered that afterwards. I have made a comment on that bug. It is a non-compliance with DOM2 but there doesn't seem to be much action to fix it.
*** This bug has been marked as a duplicate of 35011 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
verified as dup
Status: RESOLVED → VERIFIED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.