W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2017

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

From: Xidorn Quan via GitHub <sysbot+gh@w3.org>
Date: Tue, 23 May 2017 05:41:56 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-230592920-1495518115-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 10:12:53 UTC