Bug 164292 - Sticky position should not use transformed position to compute sticky offset.
Summary: Sticky position should not use transformed position to compute sticky offset.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 10
Hardware: Unspecified All
: P2 Normal
Assignee: Martin Robinson
URL:
Keywords: FromImplementor, InRadar
: 94992 (view as bug list)
Depends on:
Blocks: 228989
  Show dependency treegraph
 
Reported: 2016-11-01 14:05 PDT by Robert Flack
Modified: 2022-02-04 14:42 PST (History)
12 users (show)

See Also:


Attachments
Demo of sticky position in a transformed container. (624 bytes, text/html)
2016-11-01 14:05 PDT, Robert Flack
no flags Details
Patch (6.15 KB, patch)
2021-08-19 01:39 PDT, Martin Robinson
no flags Details | Formatted Diff | Diff
Patch (6.12 KB, patch)
2021-08-20 02:32 PDT, Martin Robinson
no flags Details | Formatted Diff | Diff
Patch (6.15 KB, patch)
2021-08-23 01:58 PDT, Martin Robinson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Flack 2016-11-01 14:05:47 PDT
Created attachment 293590 [details]
Demo of sticky position in a transformed container.

A sticky position element in a transformed container should use its untransformed position for the sticky position offset constraint. In the attached test case it should appear to stick 100px down as the transform should effectively be applied on its sticky position (See test case in Firefox or Chrome with --enable-experimental-web-platform-features).
Comment 1 Simon Fraser (smfr) 2016-11-01 14:21:17 PDT
Thanks for the report.
Comment 2 Radar WebKit Bug Importer 2016-11-01 16:21:15 PDT
<rdar://problem/29054773>
Comment 3 Martin Robinson 2021-08-19 01:39:14 PDT
Created attachment 435854 [details]
Patch
Comment 4 Martin Robinson 2021-08-19 05:25:28 PDT
*** Bug 94992 has been marked as a duplicate of this bug. ***
Comment 5 Martin Robinson 2021-08-20 02:32:13 PDT
Created attachment 435958 [details]
Patch
Comment 6 Simon Fraser (smfr) 2021-08-20 12:15:42 PDT
Comment on attachment 435958 [details]
Patch

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

> Source/WebCore/rendering/RenderBoxModelObject.cpp:493
> +    FloatRect containerRectRelativeToScrollingAncestor = containingBlock->localToContainerQuad(FloatRect(containerContentRect), &enclosingClippingBox, { } /* mode */).boundingBox();

Maybe instead of /* mode */ say /* ignore transforms */

> Source/WebCore/rendering/RenderBoxModelObject.cpp:521
> +    auto stickyBoxRelativeToScrollingAncestor = parent()->localToContainerQuad(FloatRect(stickyBoxRect), &enclosingClippingBox, { } /* mode */).boundingBox();

Ditto.
Comment 7 Martin Robinson 2021-08-23 01:58:20 PDT
Created attachment 436166 [details]
Patch
Comment 8 Martin Robinson 2021-08-23 02:08:26 PDT
(In reply to Simon Fraser (smfr) from comment #6)
> Comment on attachment 435958 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=435958&action=review
> 
> > Source/WebCore/rendering/RenderBoxModelObject.cpp:493
> > +    FloatRect containerRectRelativeToScrollingAncestor = containingBlock->localToContainerQuad(FloatRect(containerContentRect), &enclosingClippingBox, { } /* mode */).boundingBox();
> 
> Maybe instead of /* mode */ say /* ignore transforms */
> 
> > Source/WebCore/rendering/RenderBoxModelObject.cpp:521
> > +    auto stickyBoxRelativeToScrollingAncestor = parent()->localToContainerQuad(FloatRect(stickyBoxRect), &enclosingClippingBox, { } /* mode */).boundingBox();
> 
> Ditto.

Thanks for the review! I've made these changes.
Comment 9 EWS 2021-08-23 08:11:44 PDT
Committed r281446 (240829@main): <https://commits.webkit.org/240829@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 436166 [details].
Comment 10 Brent Fulgham 2022-02-04 14:42:49 PST
This change should be present in STP 139, iOS 15.4 Beta, and macOS 12.3 Beta.