Closed Bug 1576355 Opened 5 years ago Closed 5 years ago

css grid position incorrect after class name change

Categories

(Core :: Layout: Grid, defect)

68 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: James0x57, Assigned: MatsPalmgren_bugz)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

https://jsfiddle.net/s9wbd7ro/

Have a grid with grid areas that have a relative position and a % based "left" offset.
Remove the class name that causes the offset.
Re-add the class name that causes the offset.

Actual results:

the grid areas move relative to the parent Containing Block instead of relative to the grid column. The effect in the demo provided is that they move much further to the right after toggling the class name.

Expected results:

the grid areas should return to the original position, using the grid column as the Containing Block for the % calculation.

Component: Untriaged → Layout: Grid
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true

I try to bisect w/ layout.css.grid.enabled=true, However, it seems not a regression.
Before the following range: green rectangles are not displayed.
After the range: I can reproduce the the problem.

https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=0ecd7d72f232304da046b352c457e039e35ceed7&tochange=2b73b0a4d52bbd72ef8d8720256b0bba59c7de01

FYI, The problem disappears after resize browser.

Thanks Alice, yeah then it's likely not to be a regression. Chances are that the RecomputePosition optimization is not accounting for the grid containing block properly...

Has Regression Range: --- → no
Has STR: --- → yes
Blocks: 1576744
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e7511b57c48e Don't try to optimize position style changes for rel.pos. grid items. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/18684 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: