Closed Bug 632321 Opened 15 years ago Closed 15 years ago

display of new page jumps to iframe instead of staying at top

Categories

(Firefox :: General, defect)

3.6 Branch
x86
Windows 7
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: v+mozbug, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(2 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 I created a page to embed a Google Doc in an iframe. The page is displayed properly, but scrolls down to the iframe. Reproducible: Always Steps to Reproduce: 1. Click on http://nevcal.com/test/bugabc.html 2. Notice how a title appears first 3. Notice how the display jumps to the iframe Actual Results: When the rest of the page more that fills the current window, such that the iframe is not even partially on the screen, the top of the page will be shown, and then the page will jump down to the point where the iframe is fully visible at the bottom of the window. If even a little of the iframe is visible because the top content is small, then the jump dosen't happen. Expected Results: Opera doesn't jump. Chrome jumps, and then jumps back. IE jumps just like Firefox. The correct behavior, as far as I'm concerned, is not to jump (like Opera). I classify this as major as it seriously disrupts the browsing experience.
The scrolling is a result of an element.focus() call from line 663 in https://docs.google.com/static/document/client/js/627382712-v2-kix_main_i18n_kix_core.js on the element <div class="kix-appview-editor" style="overflow-y: scroll; height: 404px;" ... When an element is focused the enclosing boxes are scrolled so that the element becomes visible in the viewport. This is intentional behavior and not a bug as far as I know. It should be quite easy to work around.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
Mats, thanks for your response, I had no clue what was going on. However, my page is quite devoid of Javascript... I'm pretty good at HTML and CSS, but nearly ignorant of Javascript, particularly the event stuff... and have no clue how to modify Javascript that is coming from Google... From what I do know, I rather doubt that I can do such modifications. In particular, it seems to me that what happens inside an iframe should stay inside an iframe, and not be bubbled up to the page. The focus of the page inside the iframe should not affect the focus of the page containing the iframe. The behavior of Firefox is as if the iframe element is obtaining focus, whereas the behavior of Opera seems correct (and Chrome compensatory). I suspect that if I learned enough Javascript event coding, that the best I could do would be to make add compensation code such that after the jump to the iframe, I could jump back to the top. This would behave like Chrome, but that is still rather disruptive to the browsing experience.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
On reflection, it occurs to me that Mats did confirm the issue, by reproducing it, even though he didn't consider it to be a bug. Doesn't look like I can change the status to "confirmed" though.
Version: unspecified → 3.6 Branch
Just verified this bug still exists in Firefox 4, Beta 11.
Attached file Testcase #1 (obsolete) —
Attached file Testcase #1
Attachment #514363 - Attachment is obsolete: true
It's not a bug. Focus is global so any content on the page whether it's in a (i)frame or not should be scrolled into view so the user can see it. Google Chrome 11.0 and IE9 have the same behavior. You can avoid the problem by positioning the <iframe> so that doesn't affect scrolling while it's loading, like so: <iframe style="position:absolute; left:-2000px;top:0px" onload="this.setAttribute('style','')" ...> But it seems to me the best would be to let the Google Docs people know about the problem and ask for a solution. Then again I don't really see why you don't want the focused element to be in view.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago15 years ago
Keywords: testcase
Resolution: --- → INVALID
Mats, you said: Then again I don't really see why you don't want the focused element to be in view. I say: The answer is very simple. I have a very simple, HTML/CSS only page, that does not specify focus (is there a way to specify focus in HTML/CSS?), and so my expectation is that the focus should be at the top of the page, not way down at the bottom, where my iframe is. I'm presently not using an iframe because of this issue, instead just providing a link, but actually showing the content would be better. Why should the contents of an iframe affect the display of my page? My page is not specifying that the iframe should have focus. If focus is global, that still sounds like a bug to me... why should I have to code differently based on what gets displayed in the iframe? If I had 16 different iframes, each of which set focus, it would seem to be non-deterministic which iframe would be displayed, or if the focus would jump from one to another as they were loaded and executed. Such would be chaos. What happens in an iframe should stay in the iframe. I have Google Chrome 9, it claims to be up-to-date, and it scrolls annoyingly before jumping back to the top which is what I think it should display, but you speak of Google Chrome 11.0? I do not consider IE8 or IE9 to be standard-bearers. Opera seems to operate how I would expect. Thanks for the workaround suggestion; I think I understand how that would work... but I don't think it should be necessary.
This should not have been marked resolved. It is not an invalid complaint. I agree with everything that Glenn has stated. Google is releasing a lot of widgets (forum, calendar, etc.) with element focus inside the iframe. This is causing a massive issue in pages where the developer has no intention or desire to have the parent page scroll someplace. We are not in control of Google doing this and have no way of stoping them from doing it. As much flak as IE gets, MS got this one right. FF should NOT be scrolling to an iframe regardless of what element inside the iframe is getting focus. This bug report should be reopened and fixed.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: