You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cssom-view-1/Overview.bs
+119-10
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ Can I Use URL: https://www.w3.org/TR/cssom-view-1/
28
28
29
29
<pre class='link-defaults'>
30
30
spec:css-ui-4; type:property; text:pointer-events
31
+
spec:css2; type:dfn; text:canvas
31
32
spec:css2; type:dfn; text:viewport
32
33
spec:html; type:dfn;
33
34
text: inert
@@ -265,6 +266,22 @@ The <dfn>ending edges</dfn> of a particular set of edges of a box or element are
265
266
<dd>The top and right edges.
266
267
</dl>
267
268
269
+
The <dfn>visual viewport</dfn> is a kind of <a>viewport</a> whose <a>scrolling area</a> is another <a>viewport</a>,
270
+
called the <dfn>layout viewport</dfn>.
271
+
272
+
In addition to scrolling, the <a>visual viewport</a> may also apply a scale transform to its <a>layout viewport</a>.
273
+
This transform is applied to the <a>canvas</a> of the <a>layout viewport</a> and does not affect its internal coordinate space.
274
+
275
+
Note: The scale transform of the visual viewport is often referred to as "pinch-zoom". Conceptually, this transform
276
+
changes the size of the CSS <a>reference pixel</a> but changes the size of the layout viewport proportionally so that it
277
+
does not cause reflow of the page's contents.
278
+
279
+
The magnitude of the scale transform is known as the <a>visual viewport</a>'s <dfn>scale factor</dfn>.
280
+
281
+
The {{VisualViewport}} object has an <dfn for=visualviewport>associated document</dfn>, which is a {{Document}} object.
282
+
It is the <a for="/">associated document</a> of the owner {{Window}} of {{VisualViewport}}. The <a>layout viewport</a>
283
+
is the owner {{Window}}'s <a>viewport</a>.
284
+
268
285
For the purpose of the requirements in this specification,
269
286
elements that have a computed value of the 'display' property
270
287
that is ''table-column'' or ''table-column-group''
@@ -293,9 +310,12 @@ Note: This does not apply to e.g. {{matchMedia()}} as the units are explicitly g
293
310
294
311
<h3 id=zooming>Zooming</h3>
295
312
296
-
There are two kinds of zoom, <dfn>page zoom</dfn> which affects the size of the initial viewport<!-- XXX ref -->, and <dfn>pinch zoom</dfn> which acts like
313
+
There are two kinds of zoom, <dfn>page zoom</dfn> which affects the size of the initial viewport<!-- XXX ref -->, and the visual viewport <a>scale factor</a> which acts like
297
314
a magnifying glass and does not affect the initial viewport<!-- XXX ref --> or actual viewport<!-- XXX ref -->. [[!CSS-DEVICE-ADAPT]]
298
315
316
+
Note: The "scale factor" is often referred to as "pinch-zoom"; however, it can be affected through means other than
317
+
pinch-zooming. e.g. The user agent may zooms in on a focused input element to make it legible.
@@ -432,7 +453,7 @@ When the <dfn method for=Window caniuse=matchmedia>matchMedia(<var>query</var>)<
432
453
<var>query</var>.
433
454
<li>Return a new {{MediaQueryList}} object,
434
455
with [=this=]'s
435
-
<a>associated <code>Document</code></a>
456
+
<a for="/">associated <code>Document</code></a>
436
457
as the <a for=MediaQueryList>document</a>,
437
458
with <var>parsed media query list</var> as its associated [=MediaQueryList/media query list=].
438
459
</ol>
@@ -443,6 +464,14 @@ associated with the {{Window}} object.
443
464
Note: Accessing {{Window/screen}} through a {{WindowProxy}} object might yield different
444
465
results when the {{Document}} is navigated.
445
466
467
+
If the <a for="/">associated document</a> is <a>fully active</a>, the <dfn attribute for=Window>visualViewport</dfn>
468
+
attribute must return the {{VisualViewport}} object associated with the {{Window}} object's <a for="/">associated
469
+
document</a>. Otherwise, it must return null.
470
+
471
+
Note: the VisualViewport object is only returned and useful for a window whose Document is currently being presented. If
472
+
a reference is retained to a VisualViewport whose associated Document is not being currently presented, the values in
473
+
that VisualViewport must not reveal any information about the browsing context.
474
+
446
475
The <dfn method for=Window>moveTo(<var>x</var>, <var>y</var>)</dfn> method must follow these steps:
447
476
448
477
1. Optionally, return.
@@ -585,7 +614,7 @@ attribute must return zero. <!--fingerprint-->
585
614
The <dfn attribute for=Window caniuse=devicepixelratio>devicePixelRatio</dfn> attribute must return the result of the following <dfn export>determine the device pixel ratio</dfn> algorithm:
586
615
587
616
1. If there is no output device, return 1 and abort these steps.
588
-
1. Let <var>CSS pixel size</var> be the size of a <a lt=px value>CSS pixel</a> at the current <a>page zoom</a>scale factor and at a <a>pinch zoom</a> scale factor of 1.0.
617
+
1. Let <var>CSS pixel size</var> be the size of a <a lt=px value>CSS pixel</a> at the current <a>page zoom</a> and using a <a>scale factor</a> of 1.0.
589
618
1. Let <var>device pixel size</var> be the vertical size of a device pixel of the output device.
590
619
1. Return the result of dividing <var>CSS pixel size</var> by <var>device pixel size</var>.
591
620
@@ -1645,6 +1674,76 @@ method must run the following steps:
This section documents some of the changes between publications of this specification. This section is not exhaustive. Bug fixes and editorial changes are
1748
1853
generally not listed.
1749
1854
1855
+
<h3 id='changes-from-2022-07-07' class=no-num>Changes From 07 July 2022</h3>
1856
+
* Introduced the {{VisualViewport}} API and related concepts
1857
+
* Pinch zoom is now renamed to <a>scale factor</a>
1858
+
1750
1859
<h3 id='changes-from-2022-06-22' class=no-num>Changes From 22 June 2022</h3>
1751
1860
* Adam Argyle moved the 'scrollend' event from <a href="https://wicg.github.io/overscroll-scrollend-events/">WICG 'overscroll-scrollend-events'</a> to [[CSSOM-VIEW-1]]
1752
1861
@@ -1785,7 +1894,7 @@ generally not listed.
1785
1894
<h3 id='changes-from-2011-08-04' class=no-num>Changes From 4 August 2011 To 17 December 2013</h3>
1786
1895
1787
1896
* The specification now handles right-to-left and vertical writing modes.
1788
-
* The specification is now aware of <a>page zoom</a> and <a>pinch zoom</a>.
1897
+
* The specification is now aware of <a>page zoom</a> and pinch zoom.
1789
1898
* The 'scroll-behavior' CSS property is introduced and scrolling APIs are extended with a mechanism to control smooth scrolling.
1790
1899
* The {{Window/moveTo()}}, {{Window/moveBy()}}, {{Window/resizeTo()}} and {{Window/resizeBy()}} methods are now defined.
1791
1900
* {{Window/innerWidth}} et al now use the WebIDL type {{double}} instead of {{long}}.
0 commit comments