Closed
Bug 1076638
Opened 11 years ago
Closed 11 years ago
autofocus causes Firefox to scroll page to an element that is already on-screen
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 712130
People
(Reporter: tenderforme, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
Steps to reproduce:
first, this does not happen on Explorer, Chrome or Opera.
When i am in the middle of a page and i click on a menu button for another page, the next page do not open at the top, I have to scroll to the top. My work version is 31 but my home version is latest and it happens on botha
Actual results:
The new page do not open on the top
Expected results:
New page should open from the top
Could you test:
1) in safe mode: https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode
2) with a clean profile: https://support.mozilla.org/fr/kb/utiliser-gestionnaire-profils-creer-supprimer-profils
Flags: needinfo?(tenderforme)
I tried all the suggestions I could find, safe mode, reset, uninstall and re-install. I spend about 50 hours trying to get a reason. At first I thought it was something in my programs but Last night I tested with all the other browsers and none of the others do that.
Flags: needinfo?(tenderforme)
So I guess you tried with a clean profile (which is important to test).
Do you have a third-party program which could interfere with Firefox?
Yes, I have tried everything. The possibility of a third party interference is very unlikely because my work PC (what I do full time) is set up totally different to that of my home PC where I am doing my own development (my full time job is in a different field) and it happens on my work PC as well. I thought it might be something on the options but there is nothing there (I think) that can cause this. It is not that I lose something on the screen, it is there, but I have to scroll to the top to see it.
You can test it to see for yourself what I mean. If you go to 'tenderforme.com'. Scroll down a bit and click on one of the menu buttons (log in). The first time it opens the menu at the top but if you now click maybe 'add supplier', it opens the new page lower down. I have also registered the problem on 'stackoverflow' ( Using PHP/HTM with header (“location: ?????.php”); start next page in midle) where you will be able to see my code as well and have not received a suggestion yet. If I am doing something wrong, please tell me, this is all new to me.
(In reply to Hendrik from comment #5)
> You can test it to see for yourself what I mean. If you go to
> 'tenderforme.com'. Scroll down a bit and click on one of the menu buttons
> (log in). The first time it opens the menu at the top but if you now click
> maybe 'add supplier', it opens the new page lower down. I have also
> registered the problem on 'stackoverflow' ( Using PHP/HTM with header
> (“location: ?????.php”); start next page in midle) where you will be able to
> see my code as well and have not received a suggestion yet. If I am doing
> something wrong, please tell me, this is all new to me.
To be clear, are you meeting this issue on every website/webpage or just on http://tenderforme.com/?
I tested http://tenderforme.com/ and in fact, clicking on one of the menu entries on the left doesn't make scroll the webpage completely on top. IE11 doesn't have this behaviour.
I see where you going and that also bothered me but I do not know of another site working in in the same manner as mine, so have not been able to test another site. None of the other browsers I tested on does this (IE, Chrome and Opera).
Ok, so the issue is either in the source code of http://tenderforme.com/ or in Firefox.
If that's the 1st case, it's a Tech Evangelism bug.
I had to read up what a 'Tech Evangelism bug' is. It bothers me that it works on all other browsers but not Firefox and I set out from the beginning not to have to make provision for different browsers. If it is decided that it is a 'Tech Evangelism bug', how do I proceed to have that investigated or do you forward it to the new team.
Comment 10•11 years ago
|
||
TE bug is when the issue is in the code of the website, not in the code of Firefox.
Some websites doesn't follow the HTML specs and Firefox doesn't behave very well.
| Reporter | ||
Comment 11•11 years ago
|
||
I will not dispute that (I am new to this and it is possible I made a mistake), that is why I thought the problem is on my side from the beginning but I cannot find any reason for it. But how do I get this to be regarded as a TE bug.
Comment 12•11 years ago
|
||
I can reproduce only when using one of the two local proxies that have a cache.
No problem without a proxy or with Privoxy (no cache).
> But how do I get this to be regarded as a TE bug.
That would be moving it to the Tech Evangelism product. But I guess it wouldn't be very helpful to you anyway. :-)
Updated•11 years ago
|
Summary: New web-page do not open from the top of the page → New web-page do not open from the top of the page, scrolls down
Component: Untriaged → Desktop
Product: Firefox → Tech Evangelism
Version: 31 Branch → Firefox 33
Comment 13•11 years ago
|
||
Hi Hendrik, this is simply because you added the "autofocus" attribute, and Firefox decides to scroll down a bit in an attempt to clarify where the focused element is. Perhaps we're overdoing it a little bit and setting autofocus should not scroll unless the element is off-screen?
Comment 14•11 years ago
|
||
(This is not really a Tech Evangelism issue - it's not an error by a page to use the autofocus attribute, it's a feature. If anything needs changing here, it's a core issue to redefine how and when Firefox should scroll to an autofocused element.
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Reporter | ||
Comment 15•11 years ago
|
||
| mistake | ||
I have remove the "autofocus" command from one of my programs but the result stays the same
| Reporter | ||
Comment 16•11 years ago
|
||
Please ignore my last comment, i missed another "autofocus" in the same program. I have removed that as well now and now it works so it is the "autofocus".
Comment 17•11 years ago
|
||
I suggest you restore the autofocus for now and we ask a few more people what they think :) It might be a known issue too. Moving bug to core.
Component: Desktop → General
Product: Tech Evangelism → Core
Summary: New web-page do not open from the top of the page, scrolls down → autofocus causes Firefox to scroll page to an element that is already on-screen
Version: Firefox 33 → unspecified
Updated•11 years ago
|
Flags: needinfo?(mounir)
| Reporter | ||
Comment 18•11 years ago
|
||
I have restored it, I will reconsider the use of "autofocus" when going live
Comment 19•11 years ago
|
||
When I test with this testcase:
<div style="height: 500px"></div>
<input autofocus>
<div style="height: 5000px"></div>
we don't do any scrolling on load. Can someone please point me to a testcase where such scrolling actually happens? This bug is noticeably lacking in actual steps to reproduce...
Comment 20•11 years ago
|
||
1. Go to http://tenderforme.com/tfm/tfm_start2.php
2. Click "Add supplier" on the left.
3. Press Back.
It happens on every step, even if I scroll to top manually every time.
| Reporter | ||
Comment 21•11 years ago
|
||
I am sorry but if you look at comment 5 (2014-10-02 00:21:05 PDT) you will see I indicated how you can test it for yourself (repeated below).
(You can test it to see for yourself what I mean. If you go to 'tenderforme.com'. Scroll down a bit and click on one of the menu buttons (log in). The first time it opens the menu at the top but if you now click maybe 'add supplier', it opens the new page lower down. I have also registered the problem on 'stackoverflow' ( Using PHP/HTM with header (“location: ?????.php”); start next page in midle) where you will be able to see my code as well and have not received a suggestion yet. If I am doing something wrong, please tell me, this is all new to me.)
Comment 22•11 years ago
|
||
(In reply to [:Aleksej] from comment #20)
> It happens on every step, even if I scroll to top manually every time.
(If not, check my comment #12 for a proxy oddity.)
(In reply to Hendrik from comment #21)
> I am sorry but if you look at comment 5 (2014-10-02 00:21:05 PDT) you will
> see I indicated how you can test it for yourself (repeated below).
Your steps are not easy to notice, because it has no "http://" in the address, so it is not linkified.
| Reporter | ||
Comment 23•11 years ago
|
||
Thaks for indicating that to me, I will remember if I do something like this again. As I say, I am new to this.
Comment 24•11 years ago
|
||
I don't see any scrolling happening on Mac in either Firefox 32 or a current nightly when I follow the steps to reproduce in comment 20.
Aleksej, do you see scrolling in my small testcase from comment 19?
Comment 25•11 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #24)
> Aleksej, do you see scrolling in my small testcase from comment 19?
Not unless the field is out of screen.
Comment 26•11 years ago
|
||
Could it be related to the broken tags highlighted by Firefox's View Source, especially <body> in the middle of the page?
Comment 27•11 years ago
|
||
Seems unlikely; <body> in the middle of page is basically ignored by the parser (modulo some attribute-copying bits).
It's really strange that I can't reproduce this, and that you can't reproduce it on my testcase either.
I'd love it if someone who _can_ reproduce on the site but not on my testcase could try creating something resembling a minimal testcase.
Comment 28•11 years ago
|
||
An idea: it happens during loading, because when the styles are not applied yet, the field is much lower. Maybe the proxies just delay the application of styles.
Comment 29•11 years ago
|
||
Ah, that is entirely possible. I believe we do the focus on DOMContentLoaded, which can fire before stylesheets are fully loaded.
If so, we could delay autofocus until all sheets are in fact loaded...
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
OS: Windows 7 → All
Resolution: --- → DUPLICATE
Updated•11 years ago
|
Flags: needinfo?(mounir)
Comment 31•11 years ago
|
||
Hendrik: welcome to Bugzilla! :) If you want to follow this issue further, you can pay attention to the discussion in bug 712130, where your E-mail address is already added to the CC field so you will be notified about any discussion.
Regarding the problem, I saw this happen with a proxy enabled, it was easy to reproduce if the proxy stripped out any caching/conditional requests headers. If I used the proxy to *serve* the CSS file, the problem disappeared - but I couldn't figure out any way the CSS code itself was causing the issue.. I didn't mention this because I didn't know what to make of it, but we probably reached the right conclusion, thank you Aleksej! :)
You need to log in
before you can comment on or make changes to this bug.
Description
•