W3C home > Mailing lists > Public > www-style@w3.org > June 2012

Re: [CSSOM-view] Support centering an element when scrolling into view.

From: Thaddee Tyl <thaddee.tyl@gmail.com>
Date: Tue, 19 Jun 2012 15:24:50 -0700
Message-ID: <CAE3TfZO=cVo_QFuZ-VDsceBwewNM3a2mTGD1U2KdLBgp8MRYLg@mail.gmail.com>
To: Glenn Adams <glenn@skynav.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, robert@ocallahan.org, www-style@w3.org
I have written a more formal description of the behavior of my
proposal at <https://www.w3.org/Bugs/Public/show_bug.cgi?id=17152#c2>,
which I hope addresses most issues. I have tried as much as I could to
rely on terms already defined by the current draft.

As for Robert's concerns, I have dodged the issue by using an
ill-specified part of the current draft (or rather, a part of the
draft that isn't CSS-regions-aware).

I believe the correct way to handle elements that are fragmented
between several scrollable containers is the following:

If the scrolling box / boxes is / are associated with an element:
- Consider each fraction of the element that is broken along multiple scrollable
ancestors as independent.
- For each of those fractions, apply the scrollIntoView algorithm as if its
corresponding scrolling box was the toplevel window.
- Then, apply the usual scrollIntoView algorithm using the element's
complete bounding box.

By the way, this algorithm does conform to what major browsers do,
but does not conform to what is currently specified, afaik.
Indeed, applying scrollIntoView to an element inside a scrolling box
should not make the toplevel viewport change according to spec.
In browsers, however, the iframe does in turn get scrolled into view
(which I believe is the right thing to do).
Received on Tuesday, 19 June 2012 22:25:19 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:55 GMT