Sticky positioned element inside subgrid is contained to top level grid, not to subgrid box.
Categories
(Core :: Layout: Grid, defect)
Tracking
()
People
(Reporter: rbucata, Assigned: emilio)
References
(Regression, )
Details
(Keywords: regression, Whiteboard: [webcompat-source:web-bugs], [wptsync upstream])
Attachments
(4 files)
Environment:
Operating system: Mac OS X 10.15.7
Firefox version: Firefox 137.0
Steps to reproduce:
- Navigate to: https://codepen.io/RJWadley/pen/pvoqwBr
- Scroll the page and observe the output
Expected Behavior:
Sticky elements behave the same as in Chrome
Actual Behavior:
Sticky elements behave different compared to Chrome
Notes:
- Reproduces regardless of the status of ETP
- Reproduces in firefox-nightly, and firefox-release
- Does not reproduce in chrome
Created from https://github.com/webcompat/web-bugs/issues/152027
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 1•1 year ago
|
||
Comment 2•1 year ago
|
||
I can reproduce the issue on Nightly139.0a1 Windows11.
Regression window:
https://hg-edge.mozilla.org/integration/autoland/pushloghtml?fromchange=0ecb7e708492896313626fd3b3e3fbb8f32c42dc&tochange=eba2e80d463c05af9efe7aeba92fa82ff2d9f02a
Suspect: Bug 1679797
Comment 3•1 year ago
|
||
Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.
Comment 4•1 year ago
|
||
Set release status flags based on info from the regressing bug 1679797
:emilio, since you are the author of the regressor, bug 1679797, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 5•1 year ago
|
||
I'm not sure I agree with the expectation. The sticky pos is laid out in the whole grid container, because its parent is a subgrid... Then again I guess the subgrid could be considered its own container too, for sticky pos purposes...
Ting-Yu, any strong opinions? Maybe we should fix bug 1679797 in some other way (like what I suggested in bug 1679797 comment 7 or so?).
| Assignee | ||
Comment 6•1 year ago
|
||
Updated•1 year ago
|
Comment 7•1 year ago
|
||
Is it the same reason for broken smooth scrolling or should i open a different bug report?
Updated•1 year ago
|
Comment 8•1 year ago
|
||
Re comment 5:
Then again I guess the subgrid could be considered its own container too, for sticky pos purposes...
Ting-Yu, any strong opinions? Maybe we should fix bug 1679797 in some other way (like what I suggested in bug 1679797 comment 7 or so?).
A subgrid is a grid container itself, so it seems reasonable for it to act as a containing block for sticky positioning purposes. Both Chrome and Safari have the same behavior, so we might want to consider switching our behavior to align with them, assuming it's not too difficult to implement.
Comment 9•1 year ago
|
||
I've ran into this a few times when using subgrid as a page level macro grid for horizontal alignment. Something like this:
grid-template-columns:
[fullbleed-start]
20px
[main-start column-1-start] 1fr [column-1-end] 10px
[column-2-start] 1fr [column-2-end] 10px
[column-3-start] 1fr [column-3-end] 10px
[column-4-start] 1fr [column-4-end main-end]
20px
[fullbleed-end];
In order to align items horizontally, you need 'propagate' the subgrid down your tree like so:
grid-column: fullbleed; /* or any column */
display: grid;
grid-template-columns: subgrid;
I've been using this method to consistently align elements horizontally across entire pages. Currently there's no way to propagate the subgrid through a sticky element, since doing so would makes the sticky element align to the entire page (but only in firefox).
I think laying the sticky out on the parent grid could make sense if both the sticky and the subgrid were both affecting the same axis. When the two are in different directions though, like with a vertical sticky and horizontal columns, it doesn't make much sense to me.
| Assignee | ||
Comment 11•9 months ago
|
||
Instead, ensure we end up with a reasonable containing block reflow
input for subgrid to avoid regressing the parent.
Updated•9 months ago
|
Comment 13•9 months ago
|
||
Comment 15•9 months ago
|
||
| bugherder | ||
Updated•9 months ago
|
Updated•9 months ago
|
Comment 17•9 months ago
|
||
The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox146towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Updated•9 months ago
|
Comment 18•9 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: See blocked bug.
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: yes
- Steps to reproduce for manual QE testing: See duplicate bugs.
- Risk associated with taking this patch: low
- Explanation of risk level: Relatively straightforward fix.
- String changes made/needed: None
- Is Android affected?: yes
| Assignee | ||
Comment 19•9 months ago
|
||
Instead, ensure we end up with a reasonable containing block reflow
input for subgrid to avoid regressing the parent.
Original Revision: https://phabricator.services.mozilla.com/D272370
Updated•9 months ago
|
Updated•9 months ago
|
Comment 20•9 months ago
|
||
| uplift | ||
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Comment 21•9 months ago
|
||
Verified fixed using Nightly 147.0a1 (20251119095727) and Beta 146.0b5 (20251119090309) on Windows 10, MacOS 15.5 and Ubuntu 24.04.
Description
•