Skip to content

[css-grid] computed grid-row-start with default span integer #3448

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

Closed
ewilligers opened this issue Dec 17, 2018 · 3 comments
Closed

[css-grid] computed grid-row-start with default span integer #3448

ewilligers opened this issue Dec 17, 2018 · 3 comments

Comments

@ewilligers
Copy link
Contributor

https://drafts.csswg.org/css-grid/#grid-placement-span-int

span && [ <integer> || <custom-ident> ]
If the <integer> is omitted, it defaults to 1. Negative integers or zero are invalid.

grid-row-start "span i" computes to "span 1 i" on Blink/WebKit, but computes to "span i" on Edge/Firefox.

grid-row "span i / auto" computes to "span 1 i / auto" on Blink/WebKit, but computes to "span i / auto" on Edge, empty string on Firefox.

For many properties, the shortest serialization principle often leads to keywords being omitted, but it is unusual for numeric values to be omitted.

ewilligers pushed a commit to ewilligers/web-platform-tests that referenced this issue Dec 17, 2018
w3c/csswg-drafts#3448
computed grid-row-start with default span integer

https://bugzilla.mozilla.org/show_bug.cgi?id=1339672
grid-auto-columns/rows should accept multiple track-size values
@tabatkins
Copy link
Member

None of these are "computing to" anything. They're serializing as "span i" or "span 1 i". All browsers compute them to the same internal value.

Per the shortest serialization principle, the 1 should be omitted from the serialization here. There's nothing special about numeric values vs keywords; numerics get omitted all the time (in shorthands, particularly).

@ewilligers
Copy link
Contributor Author

http://jsfiddle.net/ericwilligers/nawfLdp8/

When we read the specified value, all browsers give "span i" and "span i / auto"

When we call getComputedStyle(), Blink and WebKit give "span 1 i" and "span 1 i / auto", while Edge and Firefox omit the 1.

@mrego
Copy link
Member

mrego commented Dec 20, 2018

JFTR, Chromium bug related to this issue: http://crbug.com/916827

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants