E46F [mediaqueries] Non-positive value should be invalid for 'resolution' feature · Issue #1454 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[mediaqueries] Non-positive value should be invalid for 'resolution' feature #1454

@upsuper

Description

@upsuper

Zero and negative values for 'resolution' feature don't make any sense, and it seems all of Firefox, Chrome, and Edge already reject non-positive values for it. The spec should follow the impl and say so.

A simple testcase:

<!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) {
  #b { background: green; }
}
@media (min-resolution: -1dpi) {
  #c { 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>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0