[csswg-drafts] [mediaqueries] Non-positive value should be invalid for 'resolution' feature

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

== [mediaqueries] Non-positive value should be invalid for 'resolution' feature ==
Zero and negative values for 'resolution' feature don't make any sense, and it seems all of Firefox, Chrome, and Edge already rejects non-positive values for it. The spec should follow the impl and say so.

A simple testcase:
```html
<!DOCTYPE html>
<style>
div {
  width: 100px; height: 100px;
  background: red;
  display: inline-block;
  margin: 10px;
}
@media (min-resolution: 1dpi) {
  #a { background: green; }
}
@media (min-resolution: 0dpi) {
  #a { background: green; }
}
@media (min-resolution: -1dpi) {
  #a { background: green; }
}
</style>
<div id="a"></div>
<div id="b"></div>
<div id="c"></div>
<pre>
<script>
let rules = document.styleSheets[0].cssRules;
for (var i = 1; i < rules.length; i++) {
  document.write(rules[i].media.mediaText + '\n');
}
</script>
</pre>
```

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

Received on Tuesday, 23 May 2017 05:42:03 UTC