Skip to content

Commit 051f0bc

Browse files
committed
Move definition of Visual Viewport from CSSOM-View
Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
1 parent 53d6722 commit 051f0bc

2 files changed

Lines changed: 18 additions & 15 deletions

File tree

css-viewport-1/Overview.bs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,35 @@ For [=paged media=], the initial containing block is based on the page area.
9191
The page area can be set through ''@page'' rules.
9292

9393
This specification introduces a way of overriding the size of the viewport
94-
provided by the user agent (UA). Because of this, we need to introduce the
95-
difference between the [=initial viewport=] and the [=layout viewport=].
94+
provided by the user agent (UA). Because of this, we need to define [=initial viewport=], [=layout viewport=] and [=visual viewport=].
9695

9796
<dl>
9897
<dt><dfn>initial viewport</dfn></dt>
9998
<dd>
10099
This refers to the viewport before any UA or author styles have
101100
overridden the viewport given by the window or viewing area of the UA.
102-
Note that the [=initial viewport=] size will change with the
101+
102+
Note: The [=initial viewport=] size will change with the
103103
size of the window or viewing area.</dd>
104104
<dt><dfn>layout viewport</dfn></dt>
105105
<dd>
106106
This is the viewport you get after processing the viewport
107107
<code>&lt;meta&gt;</code> tag.
108108
</dd>
109+
<dt><dfn>visual viewport</dfn></dt>
110+
<dd>
111+
The portion of the layout viewport that is currently visible.
112+
This is the result of applying scale transform to its layout viewport.
113+
This transform is applied to the <a>canvas</a> of the <a>layout viewport</a> and does not affect its internal coordinate space.
114+
The magnitude of the scale transform is known as the <a>visual viewport</a>'s scale factor.
115+
116+
Note: The [=visual viewport=] can be smaller than the [=layout viewport=].
117+
</dd>
109118
</dl>
110119

111-
ISSUE: Define visual viewport.
120+
Note: The scale transform of the [=visual viewport=]
121+
is often referred to as "pinch-zoom". Conceptually, this transform changes the size of the CSS <a>reference pixel</a> and changes the size
122+
of the layout viewport (inversally) proportionally so that it does not cause reflow of the page's contents.
112123

113124
When the [=layout viewport=] cannot fit inside the window or
114125
viewing area, either because the [=layout viewport=] is

cssom-view-1/Overview.bs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,9 @@ The <dfn>ending edges</dfn> of a particular set of edges of a box or element are
293293
<dd>The top and right edges.
294294
</dl>
295295

296-
The <dfn>visual viewport</dfn> is a kind of <a>viewport</a> whose <a>scrolling area</a> is another <a>viewport</a>,
297-
called the <dfn export>layout viewport</dfn>.
298-
299-
In addition to scrolling, the <a>visual viewport</a> may also apply a scale transform to its <a>layout viewport</a>.
300-
This transform is applied to the <a>canvas</a> of the <a>layout viewport</a> and does not affect its internal coordinate space.
301-
302-
Note: The scale transform of the visual viewport is often referred to as "pinch-zoom". Conceptually, this transform
303-
changes the size of the CSS <a>reference pixel</a> but changes the size of the layout viewport proportionally so that it
304-
does not cause reflow of the page's contents.
305-
306-
The magnitude of the scale transform is known as the <a>visual viewport</a>'s <dfn>scale factor</dfn>.
296+
The <a href="https://drafts.csswg.org/css-viewport-1/Overview.html#visual-viewport">visual viewport</a>'s <a>scrolling area</a> is another
297+
<a href="https://www.w3.org/TR/CSS2/visuren.html#viewport">viewport</a>,
298+
the <a href="https://drafts.csswg.org/css-viewport-1/Overview.html#layout-viewport">layout viewport</a>.
307299

308300
<style>
309301
@keyframes lvmove {

0 commit comments

Comments
 (0)