Currently, the resolved values of grid-template-rows/columns include both implicit and explicit tracks. However, specified values can only set explicit tracks. Therefore, resolved values don't round-trip: ```js gridContainer.style.gridAutoRows = "1px"; gridContainer.style.gridTemplateRows = "2px"; var cs = getComputedStyle(gridContainer); cs.gridTemplateRows; // "2px" gridItem.style.gridRow = "auto / 1"; gridContainer.style.gridTemplateRows = cs.gridTemplateRows; // "1px 2px" gridContainer.style.gridTemplateRows = cs.gridTemplateRows; // "1px 1px 2px" gridContainer.style.gridTemplateRows = cs.gridTemplateRows; // "1px 1px 1px 2px" gridContainer.style.gridTemplateRows = cs.gridTemplateRows; // "1px 1px 1px 1px 2px" ``` https://github.com/w3c/csswg-drafts/issues/4475#issuecomment-553525609 resolved to try to exclude implicit tracks and only include explicit ones.
Created attachment 387660 [details] Patch
Comment on attachment 387660 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=387660&action=review r=me. Thanks for taking care of this. > Source/WebCore/rendering/RenderGrid.cpp:872 > + // Usually we have `explicitEnd <= numPositions - 1`, but the latter may be > + // smaller when the maximum number of tracks is reached. Super nit: Not need to wrap this comment line, it's not that long for WebKit standards.
Created attachment 387768 [details] Patch
Comment on attachment 387768 [details] Patch Fixed nit
The commit-queue encountered the following flaky tests while processing attachment 387768 [details]: inspector/worker/debugger-pause.html bug 206285 (authors: drousso@apple.com and joepeck@webkit.org) The commit-queue is continuing to process your patch.
Comment on attachment 387768 [details] Patch Clearing flags on attachment: 387768 Committed r254561: <https://trac.webkit.org/changeset/254561>
All reviewed patches have been landed. Closing bug.
<rdar://problem/58601064>
Chromium has reverted this change since it was breaking some live sites, mainly devtool-like website building apps like webflow.com and educational tools like gridcritters.com. More info: - https://bugs.chromium.org/p/chromium/issues/detail?id=1069866 - https://github.com/w3c/csswg-drafts/issues/4475#issuecomment-613032475 Sounds like the Chromium team are postponing the feature until there's an API for getting measurements of implicit tracks. Disclaimer: I work at Webflow on the team responsible for the CSS Grid feature that broke due to the change in `getComputedStyle`'s API.
(In reply to Lou Acresti from comment #9) > Chromium has reverted this change since it was breaking some live sites, > mainly devtool-like website building apps like webflow.com and educational > tools like gridcritters.com. > > More info: > > - https://bugs.chromium.org/p/chromium/issues/detail?id=1069866 > - https://github.com/w3c/csswg-drafts/issues/4475#issuecomment-613032475 > > Sounds like the Chromium team are postponing the feature until there's an > API for getting measurements of implicit tracks. > > Disclaimer: I work at Webflow on the team responsible for the CSS Grid > feature that broke due to the change in `getComputedStyle`'s API. Yes we should revert here too, please Oriol take care of reverting the patch. It seems "we were lucky" and this didn't make it to Safari 13.1, so just reverting in trunk would be fine I guess. Adding Simon on CC just in case we need to do anything else.