Skip to content

Commit 6116a93

Browse files
author
Florian Rivoal
committed
Drop support for arbitrary resolutions
1 parent 59c143f commit 6116a93

File tree

2 files changed

+15
-95
lines changed

2 files changed

+15
-95
lines changed

css-device-adapt/Overview.html

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ <h3 id=the-lsquoresolutionrsquo-descriptor><span class=secno>5.10.
10971097
<tr>
10981098
<td><em>Value:</em>
10991099

1100-
<td>auto | device | &lt;resolution&gt;
1100+
<td>auto | device
11011101

11021102
<tr>
11031103
<td><em>Initial:</em>
@@ -1118,8 +1118,8 @@ <h3 id=the-lsquoresolutionrsquo-descriptor><span class=secno>5.10.
11181118
<td><em>Computed value:</em>
11191119

11201120
<td><a href="#auto4"><code class=css
1121-
title="auto!!resolution">auto</code></a>, <a href="#device"><code
1122-
class=css>device</code></a>, or a resolution value as specified.
1121+
title="auto!!resolution">auto</code></a> or <a
1122+
href="#device"><code class=css>device</code></a>’.
11231123
</table>
11241124

11251125
<p>The UA relates the CSS pixel to the <a
@@ -1128,28 +1128,16 @@ <h3 id=the-lsquoresolutionrsquo-descriptor><span class=secno>5.10.
11281128
href="http://www.w3.org/TR/CSS21/syndata.html#length-units">length
11291129
units</a> as described in CSS 2.1 <a href="#CSS21"
11301130
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>. The resolution descriptor
1131-
can be used to override the CSS pixel size chosen by the UA by setting a
1132-
CSS pixel resolution. In CSS, absolute length units are fixed in relation
1133-
to each other, hence, changing the CSS pixel resolution will for instance
1134-
change the physical length of a CSS cm.
1135-
1136-
<p>The relationship between a device pixel and a CSS pixel will depend on
1137-
the device resolution. Setting <code>resolution: 120dpi</code> on a 240dpi
1138-
device will give a 2:1 ratio between device and CSS pixels, while on a
1139-
120dpi device, the ratio will be 1:1. Likewise, the ‘<a
1140-
href="#device"><code class=css>device</code></a>’ value will always keep
1141-
a 1:1 ratio, but will give different CSS pixel resolution depending on
1142-
device resolution.
1131+
can be used to override the CSS pixel size chosen by the UA. In CSS,
1132+
absolute length units are fixed in relation to each other, hence, changing
1133+
the CSS pixel resolution will for instance change the physical length of a
1134+
CSS cm.
11431135

11441136
<p>Note that setting this descriptor will affect the used lengths for ‘<a
11451137
href="#device-width"><code class=css>device-width</code></a>’, ‘<a
11461138
href="#device-height"><code class=css>device-height</code></a>’, and the
11471139
size of the <a href="#initial-viewport">initial viewport</a>.
11481140

1149-
<p>The <dfn id=ltresolutiongt>&lt;resolution&gt;</dfn> value is a positive
1150-
&lt;number&gt; immediately followed by a unit identifier (‘<code
1151-
class=css>dpi</code>’ or ‘<code class=css>dpcm</code>’).
1152-
11531141
<p>Values have the following meanings:
11541142

11551143
<dl>
@@ -1162,22 +1150,8 @@ <h3 id=the-lsquoresolutionrsquo-descriptor><span class=secno>5.10.
11621150

11631151
<dd>Use device resolution as the CSS pixel resolution. That is, have a 1-1
11641152
relationship between a CSS and a device pixel.
1165-
1166-
<dt><a href="#ltresolutiongt"><var>&lt;resolution&gt;</var></a>
1167-
1168-
<dd>Set the CSS pixel resolution to a fixed dpi or dpcm value.
11691153
</dl>
11701154

1171-
<p class=issue>In this context, ‘<code class=css>dpi</code>’ (resp.
1172-
<code class=css>dpcm</code>’) means css pixel per physical inch
1173-
(resp. phycical centimeter). That's the oposite of what ‘<code
1174-
class=css>dpi</code>’ means in the resolution descriptor in @media. We
1175-
should probably turn in on its head here, to match what happens there.
1176-
Even better, we should probably drop the ability use &lt;resolution&gt; as
1177-
a value for this descriptor. There are clear use cases for ‘<code
1178-
class=css>auto</code>’ and for ‘<a href="#device"><code
1179-
class=css>device</code></a>’, but not for arbitrary numbers.
1180-
11811155
<h2 id=constraining-viewport-descriptor-values><span class=secno>6.
11821156
</span>Constraining viewport descriptor values</h2>
11831157

@@ -1976,11 +1950,6 @@ <h4 class="no-num no-toc" id=the-user-scalable-property>The <code
19761950
<h4 class="no-num no-toc" id=the-target-densitydpi-property>The <code
19771951
class=index id=target-densitydpi0>target-densityDpi</code> property</h4>
19781952

1979-
<p class=issue>All the values other than ‘<code
1980-
class=css>device-dpi</code>’ may change of be dropped, depending on how
1981-
we resolve the issue in ‘<a href="#resolution"><code
1982-
class=descriptor>resolution</code></a>’.
1983-
19841953
<p class=note>This property differ from the others since it is from the
19851954
WebKit implementation used in the Android browser and not supported in
19861955
Safari
@@ -1991,18 +1960,9 @@ <h4 class="no-num no-toc" id=the-target-densitydpi-property>The <code
19911960
translations.
19921961

19931962
<ol>
1994-
<li>Number values in the range <code>[70, 400]</code> are translated to
1995-
<code class=css>dpi</code>’ values.
1996-
19971963
<li><code class=index id=device-dpi>device-dpi</code> translates to ‘<a
19981964
href="#device"><code class=css>device</code></a>
19991965

2000-
<li><code class=index id=low-dpi>low-dpi</code> translates to 120dpi
2001-
2002-
<li><code class=index id=medium-dpi>medium-dpi</code> translates to 160dpi
2003-
2004-
<li><code class=index id=high-dpi>high-dpi</code> translates to 240dpi
2005-
20061966
<li>Other values are dropped
20071967
</ol>
20081968

@@ -2248,7 +2208,7 @@ <h2 class=no-num id=descriptor-index>Descriptor index</h2>
22482208
<tr>
22492209
<th><a class=property href="#resolution">resolution</a>
22502210

2251-
<td>auto | device | &lt;resolution&gt;
2211+
<td>auto | device
22522212

22532213
<td>auto
22542214

@@ -2356,8 +2316,6 @@ <h2 class=no-num id=index>Index</h2>
23562316
title="height, viewport META">#</a>
23572317
</ul>
23582318

2359-
<li>high-dpi, <a href="#high-dpi" title=high-dpi>#</a>
2360-
23612319
<li>initial-scale, <a href="#initial-scale" title=initial-scale>11.1.</a>,
23622320
<a href="#initial-scale0" title=initial-scale>#</a>
23632321

@@ -2367,8 +2325,6 @@ <h2 class=no-num id=index>Index</h2>
23672325
<li>landscape, <a href="#landscape"
23682326
title=landscape><strong>5.9.</strong></a>
23692327

2370-
<li>low-dpi, <a href="#low-dpi" title=low-dpi>#</a>
2371-
23722328
<li>max-height, <a href="#max-height"
23732329
title=max-height><strong>5.3.</strong></a>
23742330

@@ -2381,8 +2337,6 @@ <h2 class=no-num id=index>Index</h2>
23812337
<li>max-zoom, <a href="#max-zoom" title=max-zoom><strong>5.7.</strong></a>
23822338

23832339

2384-
<li>medium-dpi, <a href="#medium-dpi" title=medium-dpi>#</a>
2385-
23862340
<li>min-height, <a href="#min-height"
23872341
title=min-height><strong>5.3.</strong></a>
23882342

@@ -2407,9 +2361,6 @@ <h2 class=no-num id=index>Index</h2>
24072361
<li>resolution, <a href="#resolution"
24082362
title=resolution><strong>5.10.</strong></a>
24092363

2410-
<li>&lt;resolution&gt;, <a href="#ltresolutiongt"
2411-
title="&lt;resolution&gt;"><strong>5.10.</strong></a>
2412-
24132364
<li>target-densityDpi, <a href="#target-densitydpi"
24142365
title=target-densityDpi>11.1.</a>, <a href="#target-densitydpi0"
24152366
title=target-densityDpi>#</a>, <a href="#target-densitydpi1"

css-device-adapt/Overview.src.html

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ <h3>The &lsquo;<code class="descriptor">resolution</code>&rsquo; descriptor</h3>
860860

861861
<tr>
862862
<td><em>Value:</em></td>
863-
<td>auto | device | &lt;resolution&gt; </td>
863+
<td>auto | device</td>
864864
</tr>
865865

866866
<tr>
@@ -880,9 +880,8 @@ <h3>The &lsquo;<code class="descriptor">resolution</code>&rsquo; descriptor</h3>
880880

881881
<tr>
882882
<td><em>Computed&nbsp;value:</em></td>
883-
<td>&lsquo;<code class="css" title="auto!!resolution">auto</code>&rsquo;,
884-
&lsquo;<code class="css">device</code>&rsquo;,
885-
or a resolution value as specified.</td>
883+
<td>&lsquo;<code class="css" title="auto!!resolution">auto</code>&rsquo; or
884+
&lsquo;<code class="css">device</code>&rsquo;. </td>
886885
</tr>
887886
</tbody>
888887
</table>
@@ -892,28 +891,16 @@ <h3>The &lsquo;<code class="descriptor">resolution</code>&rsquo; descriptor</h3>
892891
or the physical
893892
<a href="http://www.w3.org/TR/CSS21/syndata.html#length-units">length units</a>
894893
as described in CSS 2.1 [[!CSS21]]. The resolution descriptor can be used to
895-
override the CSS pixel size chosen by the UA by setting a CSS pixel
896-
resolution. In CSS, absolute length units are fixed in relation to each
897-
other, hence, changing the CSS pixel resolution will for instance change
898-
the physical length of a CSS cm.</p>
899-
900-
<p>The relationship between a device pixel and a CSS pixel will depend on
901-
the device resolution. Setting <code>resolution: 120dpi</code> on a 240dpi
902-
device will give a 2:1 ratio between device and CSS pixels, while on a
903-
120dpi device, the ratio will be 1:1. Likewise, the
904-
&lsquo;<code class="css">device</code>&rsquo; value will always keep a
905-
1:1 ratio, but will give different CSS pixel resolution depending on
906-
device resolution.</p>
894+
override the CSS pixel size chosen by the UA and force a 1 to 1 mapping between
895+
CSS pixels and physical ones. In CSS, absolute length units are fixed in
896+
relation to each other, hence, changing the CSS pixel resolution will for
897+
instance change the physical length of a CSS cm.</p>
907898

908899
<p>Note that setting this descriptor will affect the used lengths for
909900
&lsquo;<code class="css">device-width</code>&rsquo;,
910901
&lsquo;<code class="css">device-height</code>&rsquo;, and the size of the
911902
<span>initial viewport</span>.
912903

913-
<p>The <dfn>&lt;resolution&gt;</dfn> value is a positive &lt;number&gt immediately
914-
followed by a unit identifier (&lsquo;<code class="css">dpi</code>&rsquo;
915-
or &lsquo;<code class=css>dpcm</code>&rsquo;).</p>
916-
917904
<p>Values have the following meanings:</p>
918905

919906
<dl>
@@ -924,18 +911,7 @@ <h3>The &lsquo;<code class="descriptor">resolution</code>&rsquo; descriptor</h3>
924911
<dd>Use device resolution as the CSS pixel resolution. That is, have a
925912
1-1 relationship between a CSS and a device pixel.</dd>
926913

927-
<dt><var>&lt;resolution&gt;</var></dt>
928-
<dd>Set the CSS pixel resolution to a fixed dpi or dpcm value.</dd>
929914
</dl>
930-
<p class="issue">In this context, ''dpi'' (resp. ''dpcm'') means css pixel
931-
per physical inch (resp. phycical centimeter). That's the oposite of what
932-
''dpi'' means in the resolution descriptor in @media. We should probably turn
933-
in on its head here, to match what happens there. Even better, we should
934-
probably drop the ability use &lt;resolution&gt; as a value for this
935-
descriptor. There are clear use cases for ''auto'' and for ''device'', but not
936-
for arbitrary numbers.
937-
</p>
938-
939915

940916
<h2>Constraining viewport descriptor values</h2>
941917

@@ -1596,8 +1572,6 @@ <h4 class="no-num no-toc">The <code class="index">user-scalable</code> property<
15961572

15971573
<h4 class="no-num no-toc">The <code class="index">target-densityDpi</code> property</h4>
15981574

1599-
<p class="issue">All the values other than ''device-dpi'' may change of be dropped, depending on how we resolve the issue in &lsquo;<code class="descriptor">resolution</code>&rsquo;.</p>
1600-
16011575
<p class="note">This property differ from the others since it is from the WebKit
16021576
implementation used in the Android browser and not supported in Safari</p>
16031577

@@ -1606,13 +1580,8 @@ <h4 class="no-num no-toc">The <code class="index">target-densityDpi</code> prope
16061580
following value translations.</p>
16071581

16081582
<ol>
1609-
<li>Number values in the range <code>[70, 400]</code> are translated to
1610-
&lsquo;<code class="css">dpi</code>&rsquo; values.</li>
16111583
<li><code class="index">device-dpi</code> translates to
16121584
&lsquo;<code class="css">device</code>&rsquo;</li>
1613-
<li><code class="index">low-dpi</code> translates to 120dpi</li>
1614-
<li><code class="index">medium-dpi</code> translates to 160dpi</li>
1615-
<li><code class="index">high-dpi</code> translates to 240dpi</li>
16161585
<li>Other values are dropped</li>
16171586
</ol>
16181587

0 commit comments

Comments
 (0)