RE: [css-position] events for position sticky

> From: Aurelio De Rosa [mailto:a.derosa@audero.it] 
> Last month http://lists.w3.org/Archives/Public/www-style/2016Mar/0252.html to demonstrate what the problem is with the current state of position: sticky, but until now I haven't received any reply.
> Can someone please give me a feedback about the possibility to introduce some events?

I think it would be great if the specification authors could weigh in here. Personally, though, I believe the reply you got at the time still makes sense: If you want to transform the element when it reaches the top, position:sticky cannot be optimized for you properly anyway, so you should rely on the scroll events (or in a not-too-distant-future the new IntersectionObserver API) to detect when you want to switch to the other design. 

Position:sticky box are still layouted where they are supposed to be without position:sticky, but then are painted at some other area. This can be seen here [1], see of the float from the flow still affects the layout once sticky is applied. Position:sticky is a paint effect, not a layout effect. It is applied in the composition thread.
 
I wouldn’t change the css properties of the box, though, I would duplicate the box and have the position:fixed one be aria-hidden=true (and display:none when not needed), and the other one become visibility:hidden whenever you toggle on the display of the fixed one.

[1] https://jsfiddle.net/Lt4f1xe1/1/

Received on Tuesday, 19 April 2016 17:20:57 UTC