Skip to content

Commit 25d3d4c

Browse files
author
Rune Lillesveen
committed
[css-device-adapt] Cascade @Viewport with initial viewport for MQ.
Used to be "recommended". Made it a "must". Changed the wording a bit.
1 parent 5bea5d6 commit 25d3d4c

File tree

2 files changed

+27
-18
lines changed

2 files changed

+27
-18
lines changed

css-device-adapt/Overview.html

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,19 +1254,24 @@ <h2 id=media-queries><span class=secno>7. </span>Media Queries</h2>
12541254
default aspect ratio of the user agent.”
12551255
</blockquote>
12561256

1257-
<p>For <code class=css>@viewport</code> rules, though, it is recommended
1258-
that they are applied before media queries for other rules are evaluated.
1257+
<p>For <code class=css>@viewport</code> rules, though, the UA must cascade
1258+
them separately with the <a href="#initial-viewport">initial viewport</a>
1259+
size used for evaluating media feature expressions and other values that
1260+
depend on the viewport size to avoid circular dependencies, but use the
1261+
actual viewport size when cascading all other properties and descriptors.
12591262

1260-
<p>Recommended procedure for applying CSS rules:
1263+
<p>Procedure for applying CSS rules:
12611264

12621265
<ol>
1263-
<li>Apply <code class=css>@viewport</code> rules. If <code
1264-
class=css>@viewport</code> rules rely on media queries, use the viewport
1265-
descriptors of the <a href="#initial-viewport">initial viewport</a>.
1266+
<li>Cascade all <code class=css>@viewport</code> rules using the <a
1267+
href="#initial-viewport">initial viewport</a> size for values and
1268+
evaluations which rely on viewport size
12661269

1267-
<li>Apply style rules. If style rules rely on media queries, use the
1268-
viewport descriptors obtained from step 1 when evaluating the media
1269-
queries.
1270+
<li>Compute the <a href="#actual-viewport">actual viewport</a> from the
1271+
cascaded viewport descriptors
1272+
1273+
<li>Cascade all other properties and descriptors using the <a
1274+
href="#actual-viewport">actual viewport</a> size
12701275
</ol>
12711276

12721277
<p class=note>The rationale for using the viewport descriptors obtained

css-device-adapt/Overview.src.html

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,18 +1000,22 @@ <h2>Media Queries</h2>
10001000
involving &lsquo;device-aspect-ratio&rsquo; will be based on the default aspect ratio
10011001
of the user agent.&rdquo;</p></blockquote>
10021002

1003-
<p>For <code class="css">@viewport</code> rules, though, it is recommended
1004-
that they are applied before media queries for other rules are evaluated.</p>
1003+
<p>For <code class="css">@viewport</code> rules, though, the UA must cascade
1004+
them separately with the <span>initial viewport</span> size used for
1005+
evaluating media feature expressions and other values that depend on the
1006+
viewport size to avoid circular dependencies, but use the actual viewport
1007+
size when cascading all other properties and descriptors.</p>
10051008

1006-
<p>Recommended procedure for applying CSS rules:</p>
1009+
<p>Procedure for applying CSS rules:</p>
10071010

10081011
<ol>
1009-
<li>Apply <code class="css">@viewport</code> rules. If
1010-
<code class="css">@viewport</code> rules rely on media queries, use
1011-
the viewport descriptors of the <span>initial viewport</span>.</li>
1012-
<li>Apply style rules. If style rules rely on media queries, use the
1013-
viewport descriptors obtained from step 1 when evaluating the media
1014-
queries.</li>
1012+
<li>Cascade all <code class="css">@viewport</code> rules using the
1013+
<span>initial viewport</span> size for values and evaluations which rely
1014+
on viewport size</li>
1015+
<li>Compute the <span>actual viewport</span> from the cascaded viewport
1016+
descriptors</li>
1017+
<li>Cascade all other properties and descriptors using the <span>actual
1018+
viewport</span> size</li>
10151019
</ol>
10161020

10171021
<p class="note">The rationale for using the viewport descriptors obtained from applying

0 commit comments

Comments
 (0)