Mozilla scrolls to the top on any unnamed anchor

RESOLVED FIXED in mozilla0.9.6



17 years ago
17 years ago


(Reporter: gerv, Assigned: kmcclusk)



Firefox Tracking Flags

(Not tracked)


Bug 80784 made it so Mozilla scrolls to the top of the document if the user
clicks on a link to any unnamed anchor.

In that bug, beppe correctly pointed out that the W3C had gone so far as to
mention this as being a _really_bad_thing_ in its Common User-Agent Problems

There is a good W3C Note that all UA implementors should read, Common User Agent 
Problems. In point 1.2, "If the user attempts to follow a link that is broken 
because it designates a missing anchor, let the user know it is broken." 
<> says:

    Wrong: Some user agents scroll to the top or bottom of the
    document when the user attempts to follow a broken link. This behavior
    is discouraged since it is indistinguishable from the correct behavior
    when a target is at the beginning or end of a document.

It seems perverse to "fix" our browser so that our CUAP compliance regresses.
(Tracking bug: 68427). The underlying problem is that the browser is taking the
user to a place the page author may not have meant them to go. There are
scenarios where this could be very bad.

The correct solution is to make "top" special, and scroll to the top only on
#top (in quirks mode only). This way, you follow the W3C, but also do what the
author blatantly intended when his intention is clear. This would fix all the
sites mentioned back in bug 80784.

Someone asked "Then why not #bottom? Or something else?". The answer to this is
that #bottom is not in common use on the web.


Comment 1

17 years ago
I added a new patch to bug 80784 whichs scrolls to the top only on #top (in
quirks mode only).

I'll check it in after I get a review/super-review.

Comment 2

17 years ago
Fix checked into the trunk. see bug 80784

Last Resolved: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla0.9.6
You need to log in before you can comment on or make changes to this bug.