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

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 UTC