W3C home > Mailing lists > Public > www-style@w3.org > November 2013

[css-position] Sticky positioning computations

From: Corey Ford <corey@coreyford.name>
Date: Mon, 25 Nov 2013 13:39:41 -0800
Message-ID: <5293C39D.5070206@coreyford.name>
To: www-style@w3.org
I'm happy to see a specification of position:sticky in a recent ED of
Positioned Layout [1]. However, I don't think the computations using a
"sticky-constraint rectangle" accurately describe sticky positioning as
outlined in my previous draft text [2], and as I understand the Webkit
and Gecko implementations. The current issues 2 and 3 hint at this.

The containing block and scrolling box influence sticky positioning
differently in that one creates a stronger constraint than the other, so
taking the intersection of two rectangles to create the
sticky-constraint rectangle isn't sufficient. Step 3 (and 4, 5, 6
similarly) of the algorithm should read something closer to:

"If the stickily positioned element's 'top' style is not 'auto', and the
top of the stickily positioned element is above the top of the scrolling
container, the stickily positioned element is moved down until its top
is at the top of the scrolling container, or its bottom is at or below
the bottom of the containing block."

Notice that the bottom of the scroll container isn't taken account. So
top-sticky elements can certainly extend past the bottom of the scroll
container, and those that are taller than their containing block won't
ever move at all.

Gecko's implementation uses two rectangles, based respectively on the
scroll container and containing block.



[1] http://dev.w3.org/csswg/css-position/#sticky-positioning
[2] http://lists.w3.org/Archives/Public/www-style/2013Jul/0337.html
Received on Wednesday, 27 November 2013 07:09:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:37 UTC