RESOLVED FIXED 236148
Implement getComputedStyle for sub grid
https://bugs.webkit.org/show_bug.cgi?id=236148
Summary Implement getComputedStyle for sub grid
Matt Woodrow
Reported 2022-02-04 11:29:33 PST
getComputedStyle should return the actual number of explicit tracks if it's a sub grid, otherwise falling back to the specified value.
Attachments
Patch (14.47 KB, patch)
2022-02-05 15:36 PST, Matt Woodrow
no flags
Patch for EWS (127.24 KB, patch)
2022-02-05 15:37 PST, Matt Woodrow
no flags
Patch (14.44 KB, patch)
2022-02-05 15:40 PST, Matt Woodrow
no flags
Patch for EWS (127.24 KB, patch)
2022-02-05 15:41 PST, Matt Woodrow
no flags
Patch (13.62 KB, patch)
2022-02-14 16:51 PST, Matt Woodrow
no flags
Patch for EWS (55.83 KB, patch)
2022-02-14 16:52 PST, Matt Woodrow
no flags
Patch (11.44 KB, patch)
2022-02-16 13:04 PST, Matt Woodrow
no flags
Patch (11.45 KB, patch)
2022-02-16 13:06 PST, Matt Woodrow
no flags
Patch for EWS (51.94 KB, patch)
2022-02-16 13:07 PST, Matt Woodrow
no flags
Matt Woodrow
Comment 1 2022-02-05 15:36:15 PST
Matt Woodrow
Comment 2 2022-02-05 15:37:17 PST
Created attachment 451005 [details] Patch for EWS
EWS Watchlist
Comment 3 2022-02-05 15:38:36 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Matt Woodrow
Comment 4 2022-02-05 15:40:35 PST
Matt Woodrow
Comment 5 2022-02-05 15:41:06 PST
Created attachment 451007 [details] Patch for EWS
Matt Woodrow
Comment 6 2022-02-14 16:51:08 PST
Matt Woodrow
Comment 7 2022-02-14 16:52:01 PST
Created attachment 451959 [details] Patch for EWS
Oriol Brufau
Comment 8 2022-02-15 18:18:41 PST
Comment on attachment 451958 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451958&action=review Looks good to me with these comments. > Source/WebCore/ChangeLog:28 > + Inherit track count from parent grid for subgridded axes and clamp item placement to that explicit grid. This is from the previous patch. > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:928 > + unsigned m_autoRepeatTotalTracks; Not counting tracks. m_autoRepeatTotalLineSets? > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:929 > + unsigned m_autoRepeatTrackListLength; Not counting tracks. m_autoRepeatLineSetListLength? > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:1002 > + if (!m_autoRepeatTotalTracks) { I don't think this can match. If m_autoRepeatTotalTracks is 0, then we will either match `i < m_insertionPoint` or `i >= m_insertionPoint + 0` above. > Source/WebCore/rendering/RenderGrid.cpp:498 > + if (isRowAxis ? isSubgridColumns() : isSubgridRows()) Could be isSubgrid(direction)
Manuel Rego Casasnovas
Comment 9 2022-02-15 22:58:41 PST
Comment on attachment 451958 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451958&action=review We miss the ChangeLog for the LayoutTest changes. > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:907 > + , m_totalTracks(totalTracksCount) Could we call this m_totalLines and store it with the +1 already? It looks we're always using it adding +1. > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:1092 > + // an appropriate grid parent?), then we fall back to using the specified value. Why a question in the comment? > Source/WebCore/rendering/style/GridPositionsResolver.cpp:82 > + // TODO: Handle subgrid auto repeat tracks Nit: s/TODO/FIXME/ > Source/WebCore/rendering/style/GridPositionsResolver.cpp:83 > + if (isRowAxis ? gridContainerStyle.gridSubgridColumns() : gridContainerStyle.gridSubgridRows()) { Could we use isSubgrid() here? > LayoutTests/TestExpectations:-1450 > -imported/w3c/web-platform-tests/css/css-grid/subgrid/grid-subgridded-axis-auto-repeater-crash-002.html [ Crash ] Aren't we passing any other test after this change?
Manuel Rego Casasnovas
Comment 10 2022-02-16 05:13:16 PST
Comment on attachment 451958 [details] Patch This patch looks good too.
Matt Woodrow
Comment 11 2022-02-16 13:04:12 PST
Matt Woodrow
Comment 12 2022-02-16 13:06:39 PST
Matt Woodrow
Comment 13 2022-02-16 13:07:17 PST
Created attachment 452237 [details] Patch for EWS
Matt Woodrow
Comment 14 2022-02-16 13:09:15 PST
(In reply to Manuel Rego Casasnovas from comment #9) > > > LayoutTests/TestExpectations:-1450 > > -imported/w3c/web-platform-tests/css/css-grid/subgrid/grid-subgridded-axis-auto-repeater-crash-002.html [ Crash ] > > Aren't we passing any other test after this change? Unfortunately not! A lot of tests check getComputedStyle, but as part of a ref test. This change gets them closer to being correct, but the grids still render incorrectly.
Oriol Brufau
Comment 15 2022-02-16 16:55:46 PST
Comment on attachment 452236 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=452236&action=review > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:929 > + unsigned m_totalLines; Can you stick to either "line" or "line set" terminology? Technically speaking it's called "line name set" https://www.w3.org/TR/css-grid-2/#line-name-set Both "line" and "line set" are probably understandable, but should be consistent.
Matt Woodrow
Comment 16 2022-02-16 17:31:33 PST
(In reply to Oriol Brufau from comment #15) > Comment on attachment 452236 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=452236&action=review > > > Source/WebCore/css/CSSComputedStyleDeclaration.cpp:929 > > + unsigned m_totalLines; > > Can you stick to either "line" or "line set" terminology? > Technically speaking it's called "line name set" > https://www.w3.org/TR/css-grid-2/#line-name-set > Both "line" and "line set" are probably understandable, but should be > consistent. m_totalLines is the actual number of lines in the grid (initialised used Grid::numTracks + 1), and isn't a count of line name sets coming from style properties.
EWS
Comment 17 2022-02-16 19:41:36 PST
Committed r289993 (247379@main): <https://commits.webkit.org/247379@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 452236 [details].
Note You need to log in before you can comment on or make changes to this bug.