Bug 106946 - Sticky-position elements can jump around/hide on rubber-banding
Summary: Sticky-position elements can jump around/hide on rubber-banding
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Beth Dakin
Keywords: InRadar
Depends on:
Blocks: 104276
  Show dependency treegraph
Reported: 2013-01-15 14:47 PST by Simon Fraser (smfr)
Modified: 2013-01-18 21:51 PST (History)
9 users (show)

See Also:

Patch (5.13 KB, patch)
2013-01-18 17:56 PST, Beth Dakin
simon.fraser: review-
Details | Formatted Diff | Diff
Patch (8.20 KB, patch)
2013-01-18 18:17 PST, Beth Dakin
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2013-01-15 14:47:12 PST
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.
Comment 1 Radar WebKit Bug Importer 2013-01-15 14:47:35 PST
Comment 2 Beth Dakin 2013-01-18 17:27:20 PST
I think I know how to fix this.
Comment 3 Beth Dakin 2013-01-18 17:56:03 PST
Created attachment 183585 [details]
Comment 4 Simon Fraser (smfr) 2013-01-18 18:03:08 PST
Comment on attachment 183585 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=183585&action=review

> Source/WebCore/rendering/RenderBoxModelObject.cpp:513
>      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() ?
Comment 5 Beth Dakin 2013-01-18 18:17:13 PST
Created attachment 183588 [details]
Comment 6 Simon Fraser (smfr) 2013-01-18 18:18:57 PST
Comment on attachment 183588 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=183588&action=review

> Source/WebCore/page/FrameView.h:194
> +    LayoutRect viewportConstrainedVisibleContentRect() const;

I think this deserves a comment saying how it's different from visibleContentRect() (rubber-banding and zooming).
Comment 7 Beth Dakin 2013-01-18 18:24:23 PST
Thank you! I added a comment http://trac.webkit.org/changeset/140229
Comment 8 Benjamin Poulain 2013-01-18 19:33:05 PST
It looks like this caused a regression on fast/css/sticky/sticky-top-zoomed.html:
Comment 9 Simon Fraser (smfr) 2013-01-18 20:58:40 PST
I think that change is expected, since this commit made sticky take zooming into account. We'll have to fix the ref test.
Comment 10 Jer Noble 2013-01-18 21:51:23 PST
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>.