Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repeat() does not get resolved as per CSS Grid #146

Open
moises-marquez opened this issue Oct 16, 2021 · 1 comment
Open

repeat() does not get resolved as per CSS Grid #146

moises-marquez opened this issue Oct 16, 2021 · 1 comment

Comments

@moises-marquez
Copy link

Basic info:

  • Node.js version: 14.17
  • jsdom version: 18.0.0

Minimal reproduction case

The following code returns repeat(auto-fill, 300px) instead of 300px 300px as described in the CSS Grid spec (Note below example 19): https://www.w3.org/TR/css-grid-1/.

const { JSDOM } = require("jsdom");

const dom = new JSDOM(`
<!DOCTYPE html>
<html>
   <head>
      <title></title>
      <style>
         #gridParentElement {
         width: 700px;
         display: grid; 
         grid-template-columns: repeat(auto-fill, 300px);
         }
      </style>
   </head>
   <body>
      <div id="gridParentElement">
         <div class="gridChild"></div>
         <div class="gridChild"></div>
      </div>
   </body>
</html>
`);

const element = window.document.querySelector("#gridParentElement");

console.log(window.getComputedStyle(element).gridTemplateColumns);

How does similar code behave in browsers?

In browser, the returned value should be 300px 300px. Link to reproducible case:

https://jsfiddle.net/y67dx3fm/

@TimothyGu
Copy link
Member

The spec for resolving repeat() as used for getComputedStyle is here: https://drafts.csswg.org/css-grid/#resolved-track-list

@TimothyGu TimothyGu transferred this issue from jsdom/jsdom Nov 29, 2021
@TimothyGu TimothyGu changed the title CSSStyleDeclaration returned by window.getComputedStyle does not follow the CCS Grid Spec repeat() does not get resolved as per CSS Grid Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants