Skip to content

Commit 45a9dd7

Browse files
author
Rune Lillesveen
committed
Let computed value of 'auto' for 'zoom' become 'auto' as used value.
Also added a section on how to handle 'auto' as used value for 'zoom'.
1 parent 1c4f9c7 commit 45a9dd7

2 files changed

Lines changed: 200 additions & 120 deletions

File tree

css-device-adapt/Overview.html

Lines changed: 109 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717

1818
<h1>CSS Device Adaptation</h1>
1919

20-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 2 November
21-
2010</h2>
20+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 3 May 2011</h2>
2221

2322
<dl>
2423
<dt>This version:
@@ -43,7 +42,7 @@ <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 2 November
4342
<!--begin-copyright-->
4443
<p class=copyright><a
4544
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
46-
rel=license>Copyright</a> &copy; 2010 <a
45+
rel=license>Copyright</a> &copy; 2011 <a
4746
href="http://www.w3.org/"><acronym title="World Wide Web
4847
Consortium">W3C</acronym></a><sup>&reg;</sup> (<a
4948
href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute
@@ -166,6 +165,11 @@ <h2 class="no-num no-toc" id=table-of-contents>Table of contents</h2>
166165
class=css>@viewport</code> properties</a>
167166
</ul>
168167

168+
<li><a href="#handling-auto-zoom"><span class=secno>10. </span>Handling
169+
&lsquo;<code class=css title="auto!!zoom">auto</code>&rsquo; for
170+
&lsquo;<code class=property title="zoom!!property">zoom</code>&rsquo;</a>
171+
172+
169173
<li class=no-num><a href="#acknowledgments">Acknowledgments</a>
170174

171175
<li class=no-num><a href="#references">References</a>
@@ -287,8 +291,8 @@ <h2 id=the-viewport-rule><span class=secno>4. </span>The <code
287291

288292
<div class=example>
289293
<p>This example sets the viewport to fit the width of the device. Note
290-
that it is enough to set the width as the zoom and height will be
291-
resolved from the width.</p>
294+
that it is enough to set the width as the height will be resolved from
295+
the width.</p>
292296

293297
<pre><!--
294298
-->@viewport {
@@ -784,8 +788,13 @@ <h3 id=the-lsquozoomrsquo-property><span class=secno>5.5. </span>The
784788
<dt>&lsquo;<code class=css><dfn id=auto0
785789
title="auto!!zoom">auto</dfn></code>&rsquo;
786790

787-
<dd>The used value is calculated from the other property values according
788-
to the <a href="#constraining-procedure">constraining procedure</a>.
791+
<dd>The zoom factor is UA-dependent. The UA may use the size of the area
792+
of the canvas on which the document is rendered to find that initial zoom
793+
factor. See <a href="#handling-auto-zoom">this section</a> for a proposed
794+
way of handling &lsquo;<a href="#auto0"><code class=css
795+
title="auto!!zoom">auto</code></a>&rsquo; values for &lsquo;<a
796+
href="#zoom"><code class=property
797+
title="zoom!!property">zoom</code></a>&rsquo;.
789798

790799
<dt><var>&lt;number&gt;</var>
791800

@@ -852,17 +861,27 @@ <h3 id=the-lsquomin-zoomrsquo-property><span class=secno>5.6. </span>The
852861
</table>
853862

854863
<p>Specifies the smallest allowed zoom factor. It is used as input to the
855-
<a href="#constraining-procedure">constraining procedure</a>, but also to
856-
limit the allowed zoom factor that can be set through user interaction.
864+
<a href="#constraining-procedure">constraining procedure</a> to constrain
865+
non-&lsquo;<a href="#auto0"><code class=css
866+
title="auto!!zoom">auto</code></a>&rsquo; &lsquo;<a href="#zoom"><code
867+
class=property title="zoom!!property">zoom</code></a>&rsquo; values, but
868+
also to limit the allowed zoom factor that can be set through user
869+
interaction. The UA should also use this value as a constraint when
870+
choosing an actual zoom factor when the used value of &lsquo;<a
871+
href="#zoom"><code class=property
872+
title="zoom!!property">zoom</code></a>&rsquo; is &lsquo;<a
873+
href="#auto0"><code class=css title="auto!!zoom">auto</code></a>&rsquo;.
857874

858875
<p>Values have the following meanings:
859876

860877
<dl>
861878
<dt>&lsquo;<code class=css><dfn id=auto1
862879
title="auto!!min-zoom">auto</dfn></code>&rsquo;
863880

864-
<dd>The used value is calculated from the other property values according
865-
to the <a href="#constraining-procedure">constraining procedure</a>.
881+
<dd>The lower limit on zoom factor is UA dependant. There will be no
882+
minimum value constraint on the &lsquo;<a href="#zoom"><code
883+
class=property title="zoom!!property">zoom</code></a>&rsquo; property
884+
used in the <a href="#constraining-procedure">constraining procedure</a>
866885

867886
<dt><var>&lt;number&gt;</var>
868887

@@ -925,17 +944,27 @@ <h3 id=the-lsquomax-zoomrsquo-property><span class=secno>5.7. </span>The
925944
</table>
926945

927946
<p>Specifies the largest allowed zoom factor. It is used as input to the <a
928-
href="#constraining-procedure">constraining procedure</a>, but also to
929-
limit the allowed zoom factor that can be set through user interaction.
947+
href="#constraining-procedure">constraining procedure</a> to constrain
948+
non-&lsquo;<a href="#auto0"><code class=css
949+
title="auto!!zoom">auto</code></a>&rsquo; &lsquo;<a href="#zoom"><code
950+
class=property title="zoom!!property">zoom</code></a>&rsquo; values, but
951+
also to limit the allowed zoom factor that can be set through user
952+
interaction. The UA should also use this value as a constraint when
953+
choosing an actual zoom factor when the used value of &lsquo;<a
954+
href="#zoom"><code class=property
955+
title="zoom!!property">zoom</code></a>&rsquo; is &lsquo;<a
956+
href="#auto0"><code class=css title="auto!!zoom">auto</code></a>&rsquo;.
930957

931958
<p>Values have the following meanings:
932959

933960
<dl>
934961
<dt>&lsquo;<code class=css><dfn id=auto2
935962
title="auto!!max-zoom">auto</dfn></code>&rsquo;
936963

937-
<dd>The used value is calculated from the other property values according
938-
to the <a href="#constraining-procedure">constraining procedure</a>.
964+
<dd>The upper limit on zoom factor is UA dependant. There will be no
965+
maximum value constraint on the &lsquo;<code
966+
class=property>zoom</code>&rsquo; property used in the <a
967+
href="#constraining-procedure">constraining procedure</a>
939968

940969
<dt><var>&lt;number&gt;</var>
941970

@@ -1095,10 +1124,8 @@ <h3 id=definitions><span class=secno>6.1. </span>Definitions</h3>
10951124

10961125
<p>For the procedure below:
10971126

1098-
<p>Computed values refer to the computed values from the property
1099-
definitions. Other values refer to the values resolved/constrained to at
1100-
that point in the procedure. The values are initially resolved to their
1101-
computed values.
1127+
<p>Properties refer to the values resolved/constrained to at that point in
1128+
the procedure. They are initially resolved to their computed values.
11021129

11031130
<p><code class=index id=width0 title="width!!resolved">width</code> and
11041131
<code class=index id=height0 title="height!!resolved">height</code> refer
@@ -1195,45 +1222,23 @@ <h4 class="no-num no-toc" id=resolve-min-zoom-and-max-zoom-values>Resolve
11951222
MAX(min-zoom, max-zoom)</code>
11961223
</ol>
11971224

1198-
<h4 class="no-num no-toc" id=resolve-zoom-value>Resolve <code
1199-
title="zoom!!resolved">zoom</code> value</h4>
1200-
1201-
<ol start=5>
1202-
<li>If the computed value of &lsquo;<a href="#zoom"><code class=property
1203-
title="zoom!!property">zoom</code></a>&rsquo; is &lsquo;<a
1204-
href="#auto0"><code class=css title="auto!!zoom">auto</code></a>&rsquo;
1205-
and <code title="width!!resolved">width</code> is not &lsquo;<a
1206-
href="#auto"><code class=css title="auto!!length">auto</code></a>&rsquo;,
1207-
set <code>zoom = (initial-width / width)</code>
1208-
1209-
<li>If <code title="zoom!!resolved">zoom</code> is &lsquo;<a
1210-
href="#auto0"><code class=css title="auto!!zoom">auto</code></a>&rsquo;,
1211-
set <code>zoom = 1</code>
1212-
1213-
<li>If the computed value of &lsquo;<a href="#zoom"><code class=property
1214-
title="zoom!!property">zoom</code></a>&rsquo; is &lsquo;<a
1215-
href="#auto0"><code class=css title="auto!!zoom">auto</code></a>&rsquo;
1216-
and <code title="height!!resolved">height</code> is not &lsquo;<a
1217-
href="#auto"><code class=css title="auto!!length">auto</code></a>&rsquo;,
1218-
set <code>zoom = MAX(zoom, (initial-height / height))</code>
1219-
</ol>
1220-
12211225
<h4 class="no-num no-toc"
12221226
id=constrain-zoom-value-to-the-min-zoom-max>Constrain <code
12231227
title="zoom!!resolved">zoom</code> value to the <code>[min-zoom,
12241228
max-zoom]</code> range</h4>
12251229

1226-
<ol start=8>
1227-
<li>Set <code>zoom = MAX(min-zoom, MIN(max-zoom, zoom))</code>
1230+
<ol start=5>
1231+
<li>If <code title="zoom!!resolved">zoom</code> is not &lsquo;<a
1232+
href="#auto0"><code class=css title="auto!!zoom">auto</code></a>&rsquo;,
1233+
set <code>zoom = MAX(min-zoom, MIN(max-zoom, zoom))</code>
12281234
</ol>
12291235

12301236
<h4 class="no-num no-toc" id=resolve-width-value>Resolve <code
12311237
title="width!!resolved">width</code> value</h4>
12321238

1233-
<ol start=9>
1234-
<li>If <code title="width!!resolved">width</code> and the computed value
1235-
of &lsquo;<a href="#zoom"><code class=property
1236-
title="zoom!!property">zoom</code></a>&rsquo; are both &lsquo;<code
1239+
<ol start=6>
1240+
<li>If <code title="width!!resolved">width</code> and <code
1241+
title="zoom!!resolved">zoom</code> are both &lsquo;<code
12371242
class=css>auto</code>&rsquo;, set <code>width = initial-width</code>
12381243

12391244
<li>If <code title="width!!resolved">width</code> is &lsquo;<code
@@ -1250,7 +1255,7 @@ <h4 class="no-num no-toc" id=resolve-width-value>Resolve <code
12501255
<h4 class="no-num no-toc" id=resolve-height-value>Resolve <code
12511256
title="height!!resolved">height</code> value</h4>
12521257

1253-
<ol start=12>
1258+
<ol start=9>
12541259
<li>If <code title="height!!resolved">height</code> is &lsquo;<code
12551260
class=css>auto</code>&rsquo;, set <code>height = width * (initial-height
12561261
/ initial-width)</code>
@@ -1260,12 +1265,20 @@ <h4 class="no-num no-toc" id=resolve-height-value>Resolve <code
12601265
id=extend-width-and-height-to-fill-the-wind>Extend <code
12611266
title="width!!resolved">width</code> and <code
12621267
title="height!!resolved">height</code> to fill the window/viewing area for
1263-
the resolved <code title="zoom!!resolved">zoom</code></h4>
1268+
the specified <code title="zoom!!resolved">zoom</code></h4>
12641269

1265-
<ol start=13>
1266-
<li>Set <code>width = MAX(width, (initial-width / zoom))</code>
1270+
<ol start=10>
1271+
<li>If <code title="zoom!!resolved">zoom</code> or <code
1272+
title="max-zoom!!resolved">max-zoom</code> is not &lsquo;<a
1273+
href="#auto0"><code class=css title="auto!!zoom">auto</code></a>&rsquo;,
1274+
set <code>width = MAX(width, (initial-width / MIN(zoom,
1275+
max-zoom)))</code>
12671276

1268-
<li>Set <code>height = MAX(height, (initial-height / zoom))</code>
1277+
<li>If <code title="zoom!!resolved">zoom</code> or <code
1278+
title="max-zoom!!resolved">max-zoom</code> is not &lsquo;<a
1279+
href="#auto0"><code class=css title="auto!!zoom">auto</code></a>&rsquo;,
1280+
set <code>height = MAX(height, (initial-height / MIN(zoom,
1281+
max-zoom)))</code>
12691282
</ol>
12701283

12711284
<div class=example>
@@ -1458,8 +1471,8 @@ <h2 id=conformance><span class=secno>8. </span>Conformance</h2>
14581471
<p>This will for instance allow UAs without zooming capabilities to
14591472
conform and still have interoperable implementations when it comes to
14601473
viewport dimensions. It will also allow the UA to choose a different
1461-
zoom factor if the content overflows the <a
1462-
href="#actual-viewport">actual viewport</a>.
1474+
zoom factor when content overflows the <a href="#actual-viewport">actual
1475+
viewport</a>.
14631476

14641477
<li>
14651478
<p>Support for the &lsquo;<a href="#user-zoom"><code
@@ -1491,7 +1504,7 @@ <h3 id=ua-stylesheet><span class=secno>9.1. </span>UA stylesheet</h3>
14911504
<!-- -->}<!--
14921505
--></pre>
14931506

1494-
<p class=note>Note that these values might not fit well with any UA. For
1507+
<p class=note>Note that these values might not fit well with all UAs. For
14951508
instance, with a min-zoom of 0.25 you will be able to fit the whole width
14961509
of the document inside the window for widths up to 1280px on a 320px wide
14971510
device like the iPhone, but only 960px if you have 240px display.
@@ -1744,6 +1757,38 @@ <h4 class="no-num no-toc" id=the-user-scalable-property>The <code
17441757
--></pre>
17451758
</div>
17461759

1760+
<h2 id=handling-auto-zoom><span class=secno>10. </span>Handling &lsquo;<a
1761+
href="#auto0"><code class=css title="auto!!zoom">auto</code></a>&rsquo;
1762+
for &lsquo;<a href="#zoom"><code class=property
1763+
title="zoom!!property">zoom</code></a>&rsquo;</h2>
1764+
1765+
<p><em>This section is not normative.</em>
1766+
1767+
<p>This section presents one way of picking an actual value for the
1768+
&lsquo;<a href="#zoom"><code class=property
1769+
title="zoom!!property">zoom</code></a>&rsquo; property when the used value
1770+
is &lsquo;<a href="#auto0"><code class=css
1771+
title="auto!!zoom">auto</code></a>.
1772+
1773+
<p>Given an <a href="#initial-viewport">initial viewport</a> with size
1774+
<code>(initial-width, initial-height)</code>, and a finite region within
1775+
the <a href="http://www.w3.org/TR/CSS21/intro.html#canvas">canvas</a>
1776+
where the formatting structure is rendered <code>(rendered-width,
1777+
rendered-height)</code>. That region is at least as large as the <a
1778+
href="#actual-viewport">actual viewport</a>.
1779+
1780+
<p>Then, if the used value of &lsquo;<a href="#zoom"><code class=property
1781+
title="zoom!!property">zoom</code></a>&rsquo; is &lsquo;<a
1782+
href="#auto0"><code class=css title="auto!!zoom">auto</code></a>&rsquo;,
1783+
let the actual zoom factor be:
1784+
1785+
<pre>
1786+
<!---->zoom = MAX(initial-width / rendered-width, initial-height / rendered-height)<!--
1787+
--></pre>
1788+
1789+
<p>The actual zoom factor should also be further limited by the [min-zoom,
1790+
max-zoom] range.
1791+
17471792
<h2 class=no-num id=acknowledgments>Acknowledgments</h2>
17481793

17491794
<h2 class=no-num id=references>References</h2>
@@ -1759,10 +1804,10 @@ <h3 class=no-num id=normative-references>Normative references</h3>
17591804
<dt id=CSS21>[CSS21]
17601805

17611806
<dd>Bert Bos; et al. <a
1762-
href="http://www.w3.org/TR/2009/CR-CSS2-20090908"><cite>Cascading Style
1763-
Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 8 September
1764-
2009. W3C Candidate Recommendation. (Work in progress.) URL: <a
1765-
href="http://www.w3.org/TR/2009/CR-CSS2-20090908">http://www.w3.org/TR/2009/CR-CSS2-20090908</a>
1807+
href="http://www.w3.org/TR/2009/CR-CSS2-20090423"><cite>Cascading Style
1808+
Sheets Level 2 Revision 1 (CSS&#160;2.1) Specification.</cite></a> 23
1809+
April 2009. W3C Candidate Recommendation. (Work in progress.) URL: <a
1810+
href="http://www.w3.org/TR/2009/CR-CSS2-20090423">http://www.w3.org/TR/2009/CR-CSS2-20090423</a>
17661811
</dd>
17671812
<!---->
17681813

@@ -1778,7 +1823,7 @@ <h3 class=no-num id=normative-references>Normative references</h3>
17781823

17791824
<dt id=CSS3VAL>[CSS3VAL]
17801825

1781-
<dd>Chris Lilley; H&#229;kon Wium Lie. <a
1826+
<dd>H&#229;kon Wium Lie; Chris Lilley. <a
17821827
href="http://www.w3.org/TR/2006/WD-css3-values-20060919"><cite>CSS3
17831828
Values and Units.</cite></a> 19 September 2006. W3C Working Draft. (Work
17841829
in progress.) URL: <a
@@ -1788,11 +1833,11 @@ <h3 class=no-num id=normative-references>Normative references</h3>
17881833

17891834
<dt id=MEDIAQ>[MEDIAQ]
17901835

1791-
<dd>Daniel Glazman; et al. <a
1792-
href="http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727"><cite>Media
1836+
<dd>H&#229;kon Wium Lie; et al. <a
1837+
href="http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/"><cite>Media
17931838
Queries.</cite></a> 27 July 2010. W3C Candidate Recommendation. (Work in
17941839
progress.) URL: <a
1795-
href="http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727">http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727</a>
1840+
href="http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/">http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/</a>
17961841
</dd>
17971842
<!---->
17981843
</dl>

0 commit comments

Comments
 (0)