diff --git a/cssom-view-1/Overview.bs b/cssom-view-1/Overview.bs index 573a4b94bb5..d56d9bee186 100644 --- a/cssom-view-1/Overview.bs +++ b/cssom-view-1/Overview.bs @@ -28,6 +28,7 @@ Can I Use URL: https://www.w3.org/TR/cssom-view-1/
spec:css-ui-4; type:property; text:pointer-events +spec:css2; type:dfn; text:canvas spec:css2; type:dfn; text:viewport spec:html; type:dfn; text: inert @@ -265,6 +266,22 @@ The ending edges of a particular set of edges of a box or element are
Document
+ associated Document
as the document,
with parsed media query list as its associated [=MediaQueryList/media query list=].
@@ -443,6 +464,14 @@ associated with the {{Window}} object.
Note: Accessing {{Window/screen}} through a {{WindowProxy}} object might yield different
results when the {{Document}} is navigated.
+If the associated document is fully active, the visualViewport
+attribute must return the {{VisualViewport}} object associated with the {{Window}} object's associated
+document. Otherwise, it must return null.
+
+Note: the VisualViewport object is only returned and useful for a window whose Document is currently being presented. If
+a reference is retained to a VisualViewport whose associated Document is not being currently presented, the values in
+that VisualViewport must not reveal any information about the browsing context.
+
The moveTo(x, y) method must follow these steps:
1. Optionally, return.
@@ -585,7 +614,7 @@ attribute must return zero.
The devicePixelRatio attribute must return the result of the following determine the device pixel ratio algorithm:
1. If there is no output device, return 1 and abort these steps.
-1. Let CSS pixel size be the size of a CSS pixel at the current page zoom scale factor and at a pinch zoom scale factor of 1.0.
+1. Let CSS pixel size be the size of a CSS pixel at the current page zoom and using a scale factor of 1.0.
1. Let device pixel size be the vertical size of a device pixel of the output device.
1. Return the result of dividing CSS pixel size by device pixel size.
@@ -1645,6 +1674,76 @@ method must run the following steps:
... +
+[Exposed=Window] +interface VisualViewport : EventTarget { + readonly attribute double offsetLeft; + readonly attribute double offsetTop; + + readonly attribute double pageLeft; + readonly attribute double pageTop; + + readonly attribute double width; + readonly attribute double height; + + readonly attribute double scale; + + attribute EventHandler onresize; + attribute EventHandler onscroll; +}; ++ +The offsetLeft attribute must run these steps: +1. If the visual viewport's associated document is not fully active, return 0. +1. Otherwise, return the offset of the left edge of the visual viewport from the left edge + of the layout viewport. + +The offsetTop attribute must run these steps: +1. If the visual viewport's associated document is not fully active, return 0. +1. Otherwise, return the offset of the top edge of the visual viewport from the top edge + of the layout viewport. + +The pageLeft attribute must run these steps: +1. If the visual viewport's associated document is not fully active, return 0. +1. Otherwise, return the offset of the left edge of the visual viewport from the left edge + of the initial containing block of the layout viewport's document. + +The pageTop attribute must run these steps: +1. If the visual viewport's associated document is not fully active, return 0. +1. Otherwise, return the offset of the top edge of the visual viewport from the top edge + of the initial containing block of the layout viewport's document. + +The width attribute must run these steps: +1. If the visual viewport's associated document is not fully active, return 0. +1. Otherwise, return the width of the visual viewport excluding the width of any rendered vertical classic + scrollbar that is fixed to the visual viewport. + +Note: Since this value is returned in CSS pixels, the value will decrease in magnitude if either page zoom or the +scale factor is increased. + +Note: A scrollbar that is fixed to the visual viewport is one that does not change size or location as the visual +viewport is zoomed and panned. Because this value is in CSS pixels, when excluding the scrollbar width the UA must +account for how large the scrollbar is as measured in CSS pixels. That is, the amount excluded decreases when zooming in +and increases when zooming out. + +The height attribute must run these steps: +1. If the visual viewport's associated document is not fully active, return 0. +1. Otherwise, return the height of the visual viewport excluding the height of any rendered horizontal classic + scrollbar that is fixed to the visual viewport. + +The scale attribute must run these steps: +1. If the visual viewport's associated document is not fully active, return 0 + and abort these steps. +1. If there is no output device, return 1 and abort these steps. +1. Otherwise, return the visual viewport's scale factor. + +onresize is the event handler IDL attribute for the resize event. + +onscroll is the event handler IDL attribute for the scroll event.
iframe
element's dimensions are changed)
since the last time these steps were run,
fire an event named resize
at the {{Window}} object associated with doc.
+1. If the {{VisualViewport}} associated with doc has had its scale,
+ width, or height properties changed since
+ the last time these steps were run, fire an event named resize at the {{VisualViewport}}.