Grid placement of absolutely positioned children not working as expected, when the grid container is a <button>
Categories
(Core :: Layout: Grid, defect)
Tracking
()
People
(Reporter: lorenzo.lipparini.it, Unassigned)
Details
Attachments
(1 file)
|
860 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0
Steps to reproduce:
Set display: grid and position: relative on a <button> element, then try to place a child element with position: absolute on the grid.
Visit the codepen at https://codepen.io/lorenzo-lipparini/pen/JjWNpyE or see the attached file for an example.
Actual results:
The absolutely positioned child will always be positioned with respect to the entire <button> container, and not the specified grid-area.
Expected results:
The child element should be placed in the specified grid-area.
Both Chrome and Safari show the expected result.
Comment 1•5 years ago
|
||
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0
Hi,
I am able to reproduce the issue in release 88, beta 89 and latest nightly 90.0a1 (2021-05-25) using Windows 10. This is not a recent regression since I am able to reproduce it in Fx70 as well.
Thanks for your input.
Comment 2•5 years ago
•
|
||
The frame tree of the grid <button> looks like this, so we construct the abspos element to be relative to the outer button control frame, not the inner grid container.
HTMLButtonControl(button)(1)@7fb4f687dcc0 parent=7fb4f687dba8 next=7fb4f687df78 (x=1800, y=0, w=18000, h=18000) normal-position=(1800,0) [content=7fb4f6306020] [cs=7fb4f68cba78] <
GridContainer(button)(1)@7fb4f687dd78 parent=7fb4f687dcc0 (x=420, y=240, w=17160, h=17520) [content=7fb4f6306020] [cs=7fb4f68cc108:-moz-button-content] <
Placeholder(div)(1)@7fb4f687def8 parent=7fb4f687dd78 (x=0, y=0, w=0, h=0) [content=7fb4f6303670] [cs=7fb4f68cc2e8:-moz-oof-placeholder] outOfFlowFrame=Block(div)(1)@7fb4f687de30
>
AbsoluteList@7fb4f6891a20 <
Block(div)(1)@7fb4f687de30 parent=7fb4f687dcc0 (x=180, y=180, w=17640, h=17640) [content=7fb4f6303670] [cs=7fb4f68cbd48] <
>
>
>
Comment 3•11 months ago
|
||
Just coming onto here to say that I think this bug has been fixed. My team encountered this issue earlier this year but we tested it again recently and found that our solution that previously didn't work is now working! I also cannot reproduce the issue in the codepen provided above in the most recent version of Firefox (v145)
Comment 4•10 months ago
|
||
mozregression finds this bug is fixed by bug 1873301.
Description
•