Scrolling to anchor should put it near top of viewport always




8 years ago
7 years ago


(Reporter: antithesis, Unassigned)


Firefox Tracking Flags

(Not tracked)


(Whiteboard: DUPEME, URL)



8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090824 Firefox/3.5.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090824 Firefox/3.5.3

Per the example url I provided, there is no indication where the anchor is within the viewport, if it is not at the top of the viewport after scrolling to it, which happens when the anchor is closer to the bottom of the document than the height of the viewport.  The user can't find the anchor and thus the anchor link is useless in this case.

My suggested fix is to scroll the anchor to the top of the viewport always, and when necessary, fill with grey color the area between the bottom of the document and bottom of the viewport.

A problem is to decide which height to use for the scroll bars normally.  I would suggest the scrollbars would always represent the height of document + grey area of the lowest (for vertical scrollbar_ and rightmost (for horizontal scrollbar) anchors.  This might break some pages which assume the ScrollWidth/Height always represent the width/height of the document - viewport. Alternatively and to solve this problem entirely, when a grey area is displayed, shorten the display of the scrollbar as if the grey area is its own frame, and let the user drag on the document edge to remove the grey area.

Another possible solution to finding anchors within the viewport is given by Bug 68402.

See also Bug 355229.

Reproducible: Always

Comment 1

8 years ago
Or better yet, just put a close or minimize [x] in the proposed "gray area".

And it doesn't need to be gray.  In the vertical case, it can be drawn to look like a (variable in size) collapsable status bar.
Whiteboard: DUPEME


8 years ago
See Also: → bug 68402, bug 355229

Comment 2

7 years ago
(In reply to Shelby Moore from comment #0)

The grey — or whatever colour — area would pose problem to the scroll bar.

But anyway, that would not be a way precise enough to indicate the target.
Often, in scientific literature, there are several anchors — references to footnotes — on the same line.
Besides, the page can have boxes and so have several lines at the same height.

I prefer a clue showing the anchor, like the blue halo iCab displays when he wants, or a marine anchor, or an arrow, or the blue highlighting of the footnote references on Wikipedia…
You need to log in before you can comment on or make changes to this bug.