Open Bug 1464444 Opened 6 years ago Updated 2 years ago

Grid line numbers are confusing (but techincally not wrong) when there is no explicit grid

Categories

(DevTools :: Inspector: Layout, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: pbro, Unassigned)

Details

(Keywords: testcase)

Attachments

(6 files)

Attached image negative-line-subgrid.PNG (deleted) —
STR: - have a build of Firefox that supports subgrids (might be in nighly soon, but ask me if not) - open https://codepen.io/anon/pen/vjqQJP?editors=1100 - open the inspector and find the <main> element in the page - in the Layout panel, turn on the grid overlay for that element and check the "Display line numbers" option --> The negative line numbers seem wrong. The first line (starting from the left) is labeled -1, but I was expecting the last line to be -1 instead.
Attached image negative-line-numbers-grid.png (deleted) —
This seems to be true for all grids, not just subgrid.
(In reply to Martin Balfanz [:mbalfanz] from comment #1) > Created attachment 8980631 [details] > negative-line-numbers-grid.png > > This seems to be true for all grids, not just subgrid. This looks correct and we actually get the negative line numbers from platform. Negative line numbers start from the last explicit grid line.
(In reply to Patrick Brosset <:pbro> from comment #0) > Created attachment 8980628 [details] > negative-line-subgrid.PNG > > STR: > - have a build of Firefox that supports subgrids (might be in nighly soon, > but ask me if not) > - open https://codepen.io/anon/pen/vjqQJP?editors=1100 > - open the inspector and find the <main> element in the page > - in the Layout panel, turn on the grid overlay for that element and check > the "Display line numbers" option > > --> The negative line numbers seem wrong. The first line (starting from the > left) is labeled -1, but I was expecting the last line to be -1 instead. This also looks correct based on where the explicit grid line is.
Priority: -- → P3
All lines in a subgrid should count as explicit though, per bullet 'f': https://drafts.csswg.org/css-grid-2/#subgrid-items This is probably a bug on the Layout side...
Assignee: nobody → mats
Status: NEW → ASSIGNED
Component: Developer Tools: Inspector → Layout
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → All

The data we send from Layout looks correct to me. ComputedGridTrackInfo has mNumLeadingImplicitTracks=0 mNumExplicitTracks=0 and mSizes has length 1, which implies there is an implicit track ("after" the non-existing explicit tracks),
which is correct for grid-template-rows:none.

devtools shows these row numbers:

1  -1

2

This is actually technically correct since line 2 is an implicit line and -1 means "last line in the explicit grid" which in this case is the same as line 1.

Assignee: mats → nobody
No longer blocks: dt-subgrid
Status: ASSIGNED → NEW
Component: Layout → Inspector: Layout
Keywords: testcase
Product: Core → DevTools
Summary: Negative line numbers seem wrong in subgrids → Grid line numbers are confusing (but techincally not wrong) when there is no explicit grid

(In this case we report mNumLeadingImplicitTracks=2 mNumExplicitTracks=0 and mSizes has length 3, which seems correct.)
In this case, devtools shows these row line numbers:

     -3
Header
     -2
Header
1    -1
Header
2

which seems technically correct to me.

Maybe Brad remembers if we did it like this on purpose or not?

(I don't really see any better way to display it, fwiw.)

(In reply to Mats Palmgren (:mats) from comment #10)

Maybe Brad remembers if we did it like this on purpose or not?

I think all the negative numbers in all of the testcases are correct because -1 is at the far end of the explicit rows and none are explicit, so it would appear on the first line, in front of the first cell. In testcase #4 it's extra weird because of the grid-row: -3 placement, which dictates where -1 lands even though there are no explicit rows. And then the positive number 1 lands where a grid-row: 1 item would appear. That is the intention behind the reporting of the grid lines -- to make them actionable such that if a user was looking at the grid inspector and devtools and thought "I want to place something there", then that user could use the reported grid lines to do so.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: