Skip to content

Commit 5d6da36

Browse files
author
Rune Lillesveen
committed
[css-device-adapt] Use 100vw/100vh instead of 100% for device-width/height
For viewport meta translation, use vw/vh instead of % to keep the possibilities to do "width=device-height" and "height=device-width".
1 parent 01313b7 commit 5d6da36

File tree

2 files changed

+14
-30
lines changed

2 files changed

+14
-30
lines changed

css-device-adapt/Overview.html

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
rel=dcterms.rights>
1212
<meta content="CSS Device Adaptation" name=dcterms.title>
1313
<meta content=text name=dcterms.type>
14-
<meta content=2013-05-30 name=dcterms.date>
14+
<meta content=2013-08-15 name=dcterms.date>
1515
<meta content="Rune Lillesveen" name=dcterms.creator>
1616
<meta content="Øyvind Stenhaug" name=dcterms.creator>
1717
<meta content="Florian Rivoal" name=dcterms.creator>
@@ -30,13 +30,13 @@
3030

3131
<h1>CSS Device Adaptation</h1>
3232

33-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 30 May 2013</h2>
33+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 15 August 2013</h2>
3434

3535
<dl>
3636
<dt>This version:
3737

3838
<dd>$Date$ (editor's draft)
39-
<!--<dd><a href="http://dev.w3.org/csswg/css-device-adapt/">http://www.w3.org/TR/2013/WD-css-device-adapt-20130530/</a></dd>-->
39+
<!--<dd><a href="http://dev.w3.org/csswg/css-device-adapt/">http://www.w3.org/TR/2013/WD-css-device-adapt-20130815/</a></dd>-->
4040

4141
<dt>Latest version:
4242

@@ -1819,25 +1819,17 @@ <h4 class="no-num no-toc" id=the-width-and-height-properties>The <code
18191819
title="device-width!!viewport META">device-width</code> and <code
18201820
class=index id=device-height0
18211821
title="device-height!!viewport META">device-height</code> translate to
1822-
100%
1822+
100vw and 100vh respectively
18231823

18241824
<li>Other keywords and unknown values translate to 1px
18251825
</ol>
18261826

18271827
<p class=note>Some existing UA implementations use device dimensions in CSS
18281828
pixels, and some use the window dimensions (CSS pixels) for device-width /
1829-
device-height. Above, we translate to 100% which are the window
1829+
device-height. Above, we translate to 100vw / 100vh which are the window
18301830
dimensions. The rationale is that the device dimensions would not be what
18311831
the author intended for UAs where the window is resizable or does not fill
1832-
the screen of the device. The rationale for using 100% and not ‘<a
1833-
href="#auto" title="auto!!length">auto</a>’, is that ‘<a href="#auto"
1834-
title="auto!!length">auto</a>’ will be affected by a length in the other
1835-
dimension. That is, <code>@viewport { width: 100%; height: 500px }</code>
1836-
will resolve width to the window width while <code>@viewport { width:
1837-
auto; height: 500px }</code> will resolve width from height and the
1838-
aspect-ratio of the window. A consequence of using percentages instead of
1839-
device dimensions, is that one cannot use device-height for width or
1840-
device-width for height.
1832+
the screen of the device.
18411833

18421834
<div class=example>
18431835
<p>This <code class=html>META</code> element:
@@ -2095,10 +2087,10 @@ <h3 class=no-num id=normative-references>Normative references</h3>
20952087
<dt id=CSS3VAL>[CSS3VAL]
20962088

20972089
<dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
2098-
href="http://www.w3.org/TR/2013/CR-css3-values-20130404/"><cite>CSS
2099-
Values and Units Module Level 3.</cite></a> 4 April 2013. W3C Candidate
2090+
href="http://www.w3.org/TR/2013/CR-css3-values-20130730/"><cite>CSS
2091+
Values and Units Module Level 3.</cite></a> 30 July 2013. W3C Candidate
21002092
Recommendation. (Work in progress.) URL: <a
2101-
href="http://www.w3.org/TR/2013/CR-css3-values-20130404/">http://www.w3.org/TR/2013/CR-css3-values-20130404/</a>
2093+
href="http://www.w3.org/TR/2013/CR-css3-values-20130730/">http://www.w3.org/TR/2013/CR-css3-values-20130730/</a>
21022094
</dd>
21032095
<!---->
21042096

css-device-adapt/Overview.src.html

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,24 +1457,16 @@ <h4 class="no-num no-toc">The
14571457
<li>Negative number values are dropped</li>
14581458
<li><code class="index" title="device-width!!viewport META">device-width</code>
14591459
and <code class="index" title="device-height!!viewport META">device-height</code>
1460-
translate to 100%</li>
1460+
translate to 100vw and 100vh respectively</li>
14611461
<li>Other keywords and unknown values translate to 1px</li>
14621462
</ol>
14631463

14641464
<p class="note">Some existing UA implementations use device dimensions in CSS
14651465
pixels, and some use the window dimensions (CSS pixels) for device-width /
1466-
device-height. Above, we translate to 100% which are the window dimensions.
1467-
The rationale is that the device dimensions would not be what the author
1468-
intended for UAs where the window is resizable or does not fill the screen
1469-
of the device. The rationale for using 100% and not
1470-
&lsquo;<span title="auto!!length">auto</span>&rsquo;, is that
1471-
&lsquo;<span title="auto!!length">auto</span>&rsquo; will be affected
1472-
by a length in the other dimension. That is, <code>@viewport { width: 100%;
1473-
height: 500px }</code> will resolve width to the window width while
1474-
<code>@viewport { width: auto; height: 500px }</code> will resolve width
1475-
from height and the aspect-ratio of the window. A consequence of using
1476-
percentages instead of device dimensions, is that one cannot use
1477-
device-height for width or device-width for height.</p>
1466+
device-height. Above, we translate to 100vw / 100vh which are the window
1467+
dimensions. The rationale is that the device dimensions would not be what
1468+
the author intended for UAs where the window is resizable or does not fill
1469+
the screen of the device.</p>
14781470

14791471
<div class="example">
14801472
<p>This <code class="html">META</code> element:</p>

0 commit comments

Comments
 (0)