[whatwg] scrollIntoView feedback

Peter Kasting pkasting at google.com
Thu Jul 31 04:09:26 PDT 2008


On Thu, Jul 31, 2008 at 2:31 AM, Ian Hickson <ian at hixie.ch> wrote:

> On Wed, 30 Apr 2008, Peter Kasting wrote:
> >    - Otherwise, if the element is not larger than the viewport, scroll
> such
> >    that the element is centered* in the viewport (within the scrolling
> limits
> >    -- if the element is at the bottom of the page, it clearly can't be
> scrolled
> >    up to the middle of the viewport).
>
> As far as I can tell, as defined, browsers would be allowed to do all this
> for scrollIntoView().


I don't read the spec that way.  The phrase "with the bottom of the element
aligned with the bottom of the viewport" seems to rule out the possibility
of other alignments such as suggested above.

If you wish browser vendors to have the freedom to experiment here, perhaps
a vague sentence such as "the user agent should scroll the element as
necessary such that as much of it as possible is visible in the viewport"
would suffice.

My impression was that Firefox 3 changed scrollIntoView behavior precisely
to comply with the detailed description currently in the spec.

It is effectively optional now. Horizontal scrolling is also required.


Now I'm wondering whether I'm looking at the wrong version of the spec,
since I don't see any of that.
http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#scrollintoviewstill
seems to read a lot like I remember it...

PK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080731/30418024/attachment-0001.htm>


More information about the whatwg mailing list