Sticky-postion elements behave oddly on rubber-banding. For example, the bug review bar on https://bugs.webkit.org/attachment.cgi?id=179870&action=review jumps around and disappear when you rubber-band at the top of the document.
I think I know how to fix this.
Created attachment 183585 [details]
Comment on attachment 183585 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=183585&action=review
> LayoutRect viewportRect = view()->frameView()->visibleContentRect();
> + viewportRect.setLocation(toPoint(view()->frameView()->scrollOffsetForFixedPosition()));
We do this in so many places that I think it's time to add something to FrameView for this. Maybe viewportConstrainedObjectRect() ?
Created attachment 183588 [details]
Comment on attachment 183588 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=183588&action=review
> + LayoutRect viewportConstrainedVisibleContentRect() const;
I think this deserves a comment saying how it's different from visibleContentRect() (rubber-banding and zooming).
Thank you! I added a comment http://trac.webkit.org/changeset/140229
It looks like this caused a regression on fast/css/sticky/sticky-top-zoomed.html:
I think that change is expected, since this commit made sticky take zooming into account. We'll have to fix the ref test.
Filed https://bugs.webkit.org/show_bug.cgi?id=107356, tracking the test failure. Test was added to TestExpectations in <http://trac.webkit.org/changeset/140234>.