[csswg-drafts] [css-values-3] attribute reference attr() length with a '0' value (#6244)

TalbotG has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values-3] attribute reference attr() length with a '0' value ==
This issue was triggered by the examination of
[attr-length-valid-zero-nofallback.html test](http://wpt.live/css/css-values/attr-length-valid-zero-nofallback.html)
in which the relevant code is

```
#outer2 { width: 200px; width: attr(data-test length); height: 200px; }
(...)
<div id="outer2" data-test="0"></div>
```

The spec states
"
The attribute value must parse as a `<dimension-token>`, and be successfully interpreted as the specified type. (...)
"
https://www.w3.org/TR/css-values-3/#ref-for-valdef-type-or-value-length

and

"
(...) `<dimension-token>` additionally have a unit composed of one or more code points. 
"
https://www.w3.org/TR/css-syntax-3/#typedef-dimension-token

Based on that alone, I believe that the attr-length-valid-zero-nofallback.html test is incorrect. 

The spec needs to be clear or become clearer for similar code scenarios where the 0 value is used without unit for `length, angle, time, frequency` 

The test also contradicts and collides with the comments made in
[attr-invalid-type-002.html test](http://wpt.live/css/css-values/attr-invalid-type-002.html)
where **the relevant code is the same** and where we can read

`#outer { width: 200px; width: attr(data-test number); height: 200px; }`
` /* NOTE: while '0' is a valid length AND a valid number, the number type isn't a valid representation of a length. */`
` /* The reason for this is that most numbers aren't valid length */`
` /* ! Spec need some updates to make those assumptions clearly valid (see Tab Atkins for details) */`
(...)
`<div id="outer" data-test="0"></div>`


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6244 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 26 April 2021 22:27:11 UTC