Closed Bug 1934619 Opened 2 months ago Closed 1 day ago

getElementsWithGrid doesn't return grid container if element has a `display: contents` ancestor

Categories

(DevTools :: Inspector: Layout, defect)

defect

Tracking

(firefox137 fixed)

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

()

Details

Attachments

(1 file)

Steps to reproduce

  1. Go to data:text/html,<meta charset=utf8><style>span { display: grid; } .content { display: contents; } </style></div><div class="content"><span>grid inside a <code>display: contents</code></span></div>
  2. Open DevTools
  3. Select the Layout panel

Expected results

In the Grid section, I can see the grid container on <span>

Actual results

In the Grid section, there's no element, only "The CSS Grid is not in use on this page"


This is an issue with getElementsWithGrid, I'll push a patch that extends the test we have for it and highlights the issue

Daniel, any idea what's happening here?

Flags: needinfo?(dholbert)
Assignee: nobody → nchevobbe
Attachment #9441070 - Attachment description: WIP: Bug 1934619 - Add test for getElementsWithGrid on display: contents element. → Bug 1934619 - Make Element::GetElementsWithGrid go through `display: contents` elements. r=#layout-reviewers.
Status: NEW → ASSIGNED

Sorry for not addressing the needinfo here, and thanks for coming up with a patch!

Flags: needinfo?(dholbert)
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/330cc0ebf18a Make Element::GetElementsWithGrid go through `display: contents` elements. r=layout-reviewers,emilio.
Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: