11
11
rel =dcterms.rights >
12
12
< meta content ="CSS Device Adaptation " name =dcterms.title >
13
13
< meta content =text name =dcterms.type >
14
- < meta content =2013-10-04 name =dcterms.date >
14
+ < meta content =2013-10-11 name =dcterms.date >
15
15
< meta content ="Rune Lillesveen " name =dcterms.creator >
16
16
< meta content ="Øyvind Stenhaug " name =dcterms.creator >
17
17
< meta content ="Florian Rivoal " name =dcterms.creator >
30
30
31
31
< h1 > CSS Device Adaptation</ h1 >
32
32
33
- < h2 class ="no-num no-toc " id = longstatus-date > Editor's Draft 4 October 2013</ h2 >
33
+ < h2 class ="no-num no-toc "> Editor's Draft 11 October 2013</ h2 >
34
34
35
35
< dl >
36
36
< dt > This version:
37
37
38
38
< 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-20131004 /</a></dd>-->
39
+ <!--<dd><a href="http://dev.w3.org/csswg/css-device-adapt/">http://www.w3.org/TR/2013/WD-css-device-adapt-20131011 /</a></dd>-->
40
40
41
41
< dt > Latest version:
42
42
@@ -105,14 +105,13 @@ <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 4 October 2013</h2>
105
105
< hr title ="Separator for header ">
106
106
</ div >
107
107
108
- < h2 class ="no-num no-toc " id = abstract > Abstract</ h2 >
108
+ < h2 class ="no-num no-toc "> Abstract</ h2 >
109
109
110
110
< p > This specification provides a way for an author to specify, in CSS, the
111
111
size, zoom factor, and orientation of the viewport that is used as the
112
112
base for the initial containing block.
113
113
114
- < h2 class ="no-num no-toc " id =status-of-this-document > Status of this
115
- document</ h2 >
114
+ < h2 class ="no-num no-toc "> Status of this document</ h2 >
116
115
<!--begin-status-->
117
116
118
117
< p > This is a public copy of the editors' draft. It is provided for
@@ -148,7 +147,7 @@ <h2 class="no-num no-toc" id=status-of-this-document>Status of this
148
147
6 of the W3C Patent Policy</ a > .</ p >
149
148
<!--end-status-->
150
149
151
- < h2 class ="no-num no-toc " id = table-of-contents > Table of Contents</ h2 >
150
+ < h2 class ="no-num no-toc "> Table of Contents</ h2 >
152
151
<!--begin-toc-->
153
152
154
153
< ul class =toc >
@@ -243,8 +242,8 @@ <h2 class="no-num no-toc" id=table-of-contents>Table of Contents</h2>
243
242
< li > < a href ="#ua-stylesheet "> < span class =secno > 12. </ span > UA stylesheets
244
243
</ a >
245
244
< ul class =toc >
246
- < li > < a href ="#desktop- ua-styles- "> < span class =secno > 12.1. </ span > Desktop
247
- UA styles </ a >
245
+ < li > < a href ="#large-screen- ua-styles- "> < span class =secno > 12.1.
246
+ </ span > Large screen UA styles </ a >
248
247
249
248
< li > < a href ="#small-screen-ua-styles "> < span class =secno > 12.2.
250
249
</ span > Small screen UA styles</ a >
@@ -320,8 +319,9 @@ <h2 id=the-viewport><span class=secno>3. </span>The viewport</h2>
320
319
feature of a user agent for continuous media and used to establish the
321
320
initial containing block for continuous media. For paged media, the
322
321
initial containing block is based on the page area. The page area can be
323
- set through @page rules. Hence, @viewport applies to continuous media, and
324
- @page to paged media, and they will not interact or conflict.
322
+ set through @page rules. Hence, < code class =css > @viewport</ code > applies
323
+ to continuous media, and @page to paged media, and they will not interact
324
+ or conflict.
325
325
326
326
< p > This specification introduces a way of overriding the size of the
327
327
viewport provided by the user agent (UA). Because of this, we need to
@@ -364,8 +364,9 @@ <h2 id=the-viewport><span class=secno>3. </span>The viewport</h2>
364
364
browser? (And what's a desktop browser)". Need to say that a "desktop"
365
365
browser typically have no UA styles, as opposed to the < a
366
366
href ="#ua-stylesheet "> UA stylesheet</ a > outlined for current mobile
367
- behaviour, and that no UA styles for @viewport will give "desktop"
368
- behaviour per default (actual viewport is initial viewport).
367
+ behaviour, and that no UA styles for < code class =css > @viewport</ code > will
368
+ give "desktop" behaviour per default (actual viewport is initial
369
+ viewport).
369
370
370
371
< h2 id =the-atviewport-rule > < span class =secno > 4. </ span > The < code
371
372
class =css > @viewport</ code > rule</ h2 >
@@ -1139,8 +1140,8 @@ <h3 id=constraining-procedure><span class=secno>6.2. </span>The procedure</h3>
1139
1140
changes in the user environment would cause them to re-evaluate Media
1140
1141
Queries.
1141
1142
1142
- < h4 class ="no-num no-toc " id = resolve-min-zoom-and-max-zoom-values > Resolve
1143
- < code title ="min-zoom!!resolved "> min-zoom</ code > and < code
1143
+ < h4 class ="no-num no-toc "> Resolve < code
1144
+ title ="min-zoom!!resolved "> min-zoom</ code > and < code
1144
1145
title ="max-zoom!!resolved "> max-zoom</ code > values</ h4 >
1145
1146
1146
1147
< ol >
@@ -1151,8 +1152,7 @@ <h4 class="no-num no-toc" id=resolve-min-zoom-and-max-zoom-values>Resolve
1151
1152
set < code > max-zoom = MAX(min-zoom, max-zoom)</ code >
1152
1153
</ ol >
1153
1154
1154
- < h4 class ="no-num no-toc "
1155
- id =constrain-zoom-value-to-the-min-zoom-max > Constrain < code
1155
+ < h4 class ="no-num no-toc "> Constrain < code
1156
1156
title ="zoom!!resolved "> zoom</ code > value to the < code > [min-zoom,
1157
1157
max-zoom]</ code > range</ h4 >
1158
1158
@@ -1175,8 +1175,7 @@ <h4 class="no-num no-toc" id=resolve-px>Resolve non-‘<a
1175
1175
descriptors.
1176
1176
</ ol >
1177
1177
1178
- < h4 class ="no-num no-toc "
1179
- id =resolve-initial-width-and-height-from-mi > Resolve initial < code
1178
+ < h4 class ="no-num no-toc "> Resolve initial < code
1180
1179
title ="width!!resolved "> width</ code > and < code
1181
1180
title ="height!!resolved "> height</ code > from min/max descriptors</ h4 >
1182
1181
@@ -1192,7 +1191,7 @@ <h4 class="no-num no-toc" id=resolve-px>Resolve non-‘<a
1192
1191
< code > height = MAX(min-height, MIN(max-height, initial-height))</ code >
1193
1192
</ ol >
1194
1193
1195
- < h4 class ="no-num no-toc " id = resolve-width-value > Resolve < code
1194
+ < h4 class ="no-num no-toc "> Resolve < code
1196
1195
title ="width!!resolved "> width</ code > value</ h4 >
1197
1196
1198
1197
< ol id =ol6 >
@@ -1207,7 +1206,7 @@ <h4 class="no-num no-toc" id=resolve-width-value>Resolve <code
1207
1206
title ="height!!initial "> initial-height</ code > is 0.
1208
1207
</ ol >
1209
1208
1210
- < h4 class ="no-num no-toc " id = resolve-height-value > Resolve < code
1209
+ < h4 class ="no-num no-toc "> Resolve < code
1211
1210
title ="height!!resolved "> height</ code > value</ h4 >
1212
1211
1213
1212
< ol id =ol8 >
@@ -1695,8 +1694,8 @@ <h3 id=lsquoextend-to-zoomrsquo><span class=secno>10.3. </span>‘<code
1695
1694
the initial width is 320px, < code class =html > <meta name="viewport"
1696
1695
content="width=10"></ code > will resolve to 64px.
1697
1696
1698
- < h4 class ="no-num no-toc " id = resolving-lsquoextend-to-zoomrsquo > Resolving
1699
- ‘ < code class = css title =extend-to-zoom > extend-to-zoom</ code > ’</ h4 >
1697
+ < h4 class ="no-num no-toc "> Resolving ‘ < code class = css
1698
+ title =extend-to-zoom > extend-to-zoom</ code > ’</ h4 >
1700
1699
1701
1700
< p > The ‘< code class =css title =extend-to-zoom > extend-to-zoom</ code > ’
1702
1701
value is resolved to pixel or auto lengths as part of < a
@@ -1772,14 +1771,13 @@ <h3 id=translation-into-atviewport-descriptors><span class=secno>10.4.
1772
1771
< p > Each of the property/value pair from the parsing in the previous section
1773
1772
are translated, and added to that single at-rule as follows:
1774
1773
1775
- < h4 class ="no-num no-toc " id = unknown-properties > Unknown properties</ h4 >
1774
+ < h4 class ="no-num no-toc "> Unknown properties</ h4 >
1776
1775
1777
1776
< p > Unknown properties are dropped.
1778
1777
1779
- < h4 class ="no-num no-toc " id =the-width-and-height-properties > The < code
1780
- class =index id =width2 title ="width!!viewport META "> width</ code > and < code
1781
- class =index id =height2 title ="height!!viewport META "> height</ code >
1782
- properties</ h4 >
1778
+ < h4 class ="no-num no-toc "> The < code class =index id =width2
1779
+ title ="width!!viewport META "> width</ code > and < code class =index id =height2
1780
+ title ="height!!viewport META "> height</ code > properties</ h4 >
1783
1781
1784
1782
< p > The < code class =index id =width3
1785
1783
title ="width!!viewport META "> width</ code > and < code class =index id =height3
@@ -1883,9 +1881,9 @@ <h4 class="no-num no-toc" id=the-width-and-height-properties>The <code
1883
1881
--> </ pre >
1884
1882
</ div >
1885
1883
1886
- < h4 class ="no-num no-toc " id = the-initial-scale-minimum-scale-and-maxi > The
1887
- < code class = index id =initial-scale0 > initial-scale</ code > , < code
1888
- class = index id =minimum-scale0 > minimum-scale</ code > , and < code class =index
1884
+ < h4 class ="no-num no-toc "> The < code class = index
1885
+ id =initial-scale0 > initial-scale</ code > , < code class = index
1886
+ id =minimum-scale0 > minimum-scale</ code > , and < code class =index
1889
1887
id =maximum-scale0 > maximum-scale</ code > properties</ h4 >
1890
1888
1891
1889
< p > The properties are translated into ‘< code class =descriptor
@@ -1923,8 +1921,8 @@ <h4 class="no-num no-toc" id=the-initial-scale-minimum-scale-and-maxi>The
1923
1921
the UA stylesheet ‘< a href ="#max-zoom "> < code
1924
1922
class =descriptor > max-zoom</ code > </ a > ’ value.
1925
1923
1926
- < h4 class ="no-num no-toc " id = the-user-scalable-property > The < code
1927
- class = index id =user-scalable0 > user-scalable</ code > property</ h4 >
1924
+ < h4 class ="no-num no-toc "> The < code class = index
1925
+ id =user-scalable0 > user-scalable</ code > property</ h4 >
1928
1926
1929
1927
< p > The < code class =index id =user-scalable1 > user-scalable</ code > property is
1930
1928
translated into ‘< a href ="#user-zoom "> < code
@@ -1998,27 +1996,40 @@ <h2 id=ua-stylesheet><span class=secno>12. </span>UA stylesheets</h2>
1998
1996
1999
1997
< p > < em > This section is informative</ em >
2000
1998
2001
- < p > With the term desktop browser below, we mean a browser which has a size
2002
- of the initial viewport, in CSS pixels, that is at least as large as the
2003
- smallest viewport or viewing area you would expect a user of a desktop
2004
- computer to have. In that sense, it could include tablet PC and TV
2005
- browsers .
1999
+ < p > Traditional user agents, used mostly on desktop and laptop computers,
2000
+ can easily be resized to fit most websites inside the initial viewport
2001
+ without breaking the layout. Using the recommendations below, sites not
2002
+ adding any < code class = css > @viewport </ code > rules themselves will continue
2003
+ to look and function like they always have .
2006
2004
2007
- < h3 id =desktop-ua-styles- > < span class =secno > 12.1. </ span > Desktop UA styles</ h3 >
2005
+ < h3 id =large-screen-ua-styles- > < span class =secno > 12.1. </ span > Large screen
2006
+ UA styles</ h3 >
2008
2007
2009
- < p > For a desktop browser, the recommendation is to have no UA styles. That
2010
- means that it will have all descriptors initially set to ‘< code
2008
+ < p > For browsers with an initial viewport size large enough to fit common
2009
+ websites without breaking the layout, or which can easily to resized to do
2010
+ so, the recommendation is to have < em > no</ em > UA styles. That means that
2011
+ it will have all descriptors initially set to ‘< code
2011
2012
class =css > auto</ code > ’, and behave as it would have without support for
2012
- viewport descriptors if there are no viewport descriptors in the user or
2013
- author styles.
2013
+ viewport descriptors.
2014
+
2015
+ < p > For browsers which support changing orientation, and the portrait mode
2016
+ breaks this the above, it is recommended to set a minimum layout width,
2017
+ equal to that of the width in landscape mode.
2018
+
2019
+ < div class =example >
2020
+ < pre > <!--
2021
+ --> @viewport {
2022
+ <!-- --> min-width: 1024px;
2023
+ <!-- --> }<!--
2024
+ --> </ pre >
2025
+ </ div >
2014
2026
2015
2027
< h3 id =small-screen-ua-styles > < span class =secno > 12.2. </ span > Small screen
2016
2028
UA styles</ h3 >
2017
2029
2018
- < p > For smaller screen UAs like smartphone browsers, the UA could typically
2019
- set the minimum viewport width to something that is at least as large as
2020
- the narrowest width an author would expect a desktop user would use to
2021
- view documents.
2030
+ < p > For smaller screen UAs, the UA could set the minimum viewport width to
2031
+ typically used as an initial viewport width of a traditional user agent
2032
+ (as described above).
2022
2033
2023
2034
< div class =example >
2024
2035
< pre > <!--
@@ -2050,20 +2061,20 @@ <h3 class=no-num id=normative-references>Normative references</h3>
2050
2061
< dt id =CSS21 > [CSS21]
2051
2062
2052
2063
< dd > Bert Bos; et al. < a
2053
- href ="http://www.w3.org/TR/2011/REC-CSS2-20110607/ "> < cite > Cascading Style
2064
+ href ="http://www.w3.org/TR/2011/REC-CSS2-20110607 "> < cite > Cascading Style
2054
2065
Sheets Level 2 Revision 1 (CSS 2.1) Specification.</ cite > </ a > 7 June
2055
2066
2011. W3C Recommendation. URL: < a
2056
- href ="http://www.w3.org/TR/2011/REC-CSS2-20110607/ "> http://www.w3.org/TR/2011/REC-CSS2-20110607/ </ a >
2067
+ href ="http://www.w3.org/TR/2011/REC-CSS2-20110607 "> http://www.w3.org/TR/2011/REC-CSS2-20110607</ a >
2057
2068
</ dd >
2058
2069
<!---->
2059
2070
2060
2071
< dt id =CSS3SYN > [CSS3SYN]
2061
2072
2062
- < dd > L. David Baron . < a
2063
- href ="http://www.w3.org/TR/2003 /WD-css3 -syntax-20030813 "> < cite > CSS3
2064
- module: Syntax.</ cite > </ a > 13 August 2003 . W3C Working Draft. (Work in
2065
- progress.) URL: < a
2066
- href ="http://www.w3.org/TR/2003 /WD-css3 -syntax-20030813 "> http://www.w3.org/TR/2003 /WD-css3 -syntax-20030813 </ a >
2073
+ < dd > Tab Atkins Jr.; Simon Sapin . < a
2074
+ href ="http://www.w3.org/TR/2013 /WD-css -syntax-3-20130919/ "> < cite > CSS
2075
+ Syntax Module Level 3 .</ cite > </ a > 19 September 2013 . W3C Working Draft.
2076
+ (Work in progress.) URL: < a
2077
+ href ="http://www.w3.org/TR/2013 /WD-css -syntax-3-20130919/ "> http://www.w3.org/TR/2013 /WD-css -syntax-3-20130919/ </ a >
2067
2078
</ dd >
2068
2079
<!---->
2069
2080
0 commit comments