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
"generatedSubtitle": "W3C Editor's Draft 19 March 2026"
295
295
}</script>
296
296
<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2021/W3C-ED"></head><body data-cite="WEBIDL CSSOM-VIEW GEOMETRY-1 fileapi HTML INFRA URL WEBIDL DOM FETCH" class="h-entry"><div class="head">
They work by dumping a snapshot of the <a href="#dfn-viewport" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-viewport-4">initial viewport</a>'s
11695
+
They work by dumping a snapshot of the <a href="#dfn-visual-viewport" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-visual-viewport-1">visual viewport</a>'s
11696
11696
framebuffer as a lossless PNG image.
11697
11697
It is returned to the <a href="#dfn-local-ends" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-local-ends-18">local end</a> as a Base64 encoded string.
to capture the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#top-level-browsing-context" id="ref-for-index-term-top-level-browsing-contexts-28">top-level browsing context</a>'s <a href="#dfn-viewport" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-viewport-5">initial viewport</a>,
11700
+
to capture the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/document-sequences.html#top-level-browsing-context" id="ref-for-index-term-top-level-browsing-contexts-28">top-level browsing context</a>'s <a href="#dfn-visual-viewport" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-visual-viewport-2">visual viewport</a>,
11701
11701
and a <a href="#dfn-commands" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-commands-61">command</a> <a href="#dfn-take-element-screenshot" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-take-element-screenshot-2">Take Element Screenshot</a>
11702
11702
for doing the same with the visible region of an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-element" id="ref-for-index-term-element-42">element</a>'s
11703
11703
<a href="#dfn-bounding-rectangle" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-bounding-rectangle-4">bounding rectangle</a> after it has been <a href="#dfn-scrolls-into-view" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-scrolls-into-view-7">scrolled into view</a>.
given a <a href="#dfn-bounding-rectangle" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-bounding-rectangle-5">rectangle</a>:
11707
11707
11708
11708
</p><ol>
11709
-
<li><p>If either the <a href="#dfn-viewport" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-viewport-6">initial viewport</a>'s width or height
11709
+
<li><p>If either the <a href="#dfn-visual-viewport" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-visual-viewport-3">visual viewport</a>'s width or height
11710
11710
is 0 <a href="#dfn-css-pixels" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-css-pixels-11">CSS pixels</a>,
to ascertain the visibility of an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-element" id="ref-for-index-term-element-45">element</a> in the <a href="#dfn-viewport" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-viewport-9">viewport</a>,
12233
+
to ascertain the visibility of an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-element" id="ref-for-index-term-element-45">element</a> in the <a href="#dfn-viewport" class="internalDFN" data-link-type="dfn" id="ref-for-dfn-viewport-4">viewport</a>,
12234
12234
we acknowledge that it is an important feature for many users.
12235
12235
Here we include a recommended approach
12236
12236
which will give a simplified approximation of an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-element" id="ref-for-index-term-element-46">element</a>'s visibility,
</dd><dd>The following terms are defined in [<cite><a class="bibref" data-link-type="biblio" href="#bib-mediaqueries-4" title="Media Queries Level 4">mediaqueries-4</a></cite>]:
<a href="https://www.w3.org/TR/accname-1.1/"><cite>Accessible Name and Description Computation 1.1</cite></a>. Joanmarie Diggs; Bryan Garaventa; Michael Cooper. W3C. 18 December 2018. W3C Recommendation. URL: <a href="https://www.w3.org/TR/accname-1.1/">https://www.w3.org/TR/accname-1.1/</a>
14283
14286
</dd><dt id="bib-csp3">[CSP3]</dt><dd>
14284
-
<a href="https://www.w3.org/TR/CSP3/"><cite>Content Security Policy Level 3</cite></a>. Mike West; Antonio Sartori. W3C. 6 February 2026. W3C Working Draft. URL: <a href="https://www.w3.org/TR/CSP3/">https://www.w3.org/TR/CSP3/</a>
14287
+
<a href="https://www.w3.org/TR/CSP3/"><cite>Content Security Policy Level 3</cite></a>. Mike West; Antonio Sartori. W3C. 11 March 2026. W3C Working Draft. URL: <a href="https://www.w3.org/TR/CSP3/">https://www.w3.org/TR/CSP3/</a>
<a href="https://infra.spec.whatwg.org/"><cite>Infra Standard</cite></a>. Anne van Kesteren; Domenic Denicola. WHATWG. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a>
<a href="https://www.w3.org/TR/pointerevents/"><cite>Pointer Events</cite></a>. Jacob Rossi; Matt Brubeck. W3C. 4 April 2019. W3C Recommendation. URL: <a href="https://www.w3.org/TR/pointerevents/">https://www.w3.org/TR/pointerevents/</a>
14331
+
<a href="https://www.w3.org/TR/pointerevents4/"><cite>Pointer Events</cite></a>. Patrick Lauke; Robert Flack. W3C. 25 February 2026. W3C Working Draft. URL: <a href="https://www.w3.org/TR/pointerevents4/">https://www.w3.org/TR/pointerevents4/</a>
<a href="https://www.unicode.org/reports/tr44/tr44-36.html"><cite>Unicode Character Database</cite></a>. Ken Whistler. Unicode Consortium. 27 August 2025. Unicode Standard Annex #44. URL: <a href="https://www.unicode.org/reports/tr44/tr44-36.html">https://www.unicode.org/reports/tr44/tr44-36.html</a>
14361
14364
</dd><dt id="bib-ui-events">[UI-EVENTS]</dt><dd>
14362
-
<a href="https://www.w3.org/TR/uievents/"><cite>UI Events</cite></a>. Gary Kacmarcik; Travis Leithead. W3C. 7 September 2024. W3C Working Draft. URL: <a href="https://www.w3.org/TR/uievents/">https://www.w3.org/TR/uievents/</a>
14365
+
<a href="https://www.w3.org/TR/uievents/"><cite>UI Events</cite></a>. Xiaoqian Wu. W3C. 21 February 2026. W3C Working Draft. URL: <a href="https://www.w3.org/TR/uievents/">https://www.w3.org/TR/uievents/</a>
<a href="https://www.w3.org/TR/webdriver-bidi/"><cite>WebDriver BiDi</cite></a>. James Graham; Alex Rudenko; Maksim Sadym. W3C. 28 January 2026. W3C Working Draft. URL: <a href="https://www.w3.org/TR/webdriver-bidi/">https://www.w3.org/TR/webdriver-bidi/</a>
14377
+
<a href="https://www.w3.org/TR/webdriver-bidi/"><cite>WebDriver BiDi</cite></a>. James Graham; Alex Rudenko; Maksim Sadym. W3C. 17 March 2026. W3C Working Draft. URL: <a href="https://www.w3.org/TR/webdriver-bidi/">https://www.w3.org/TR/webdriver-bidi/</a>
14375
14378
</dd><dt id="bib-webidl">[WEBIDL]</dt><dd>
14376
14379
<a href="https://webidl.spec.whatwg.org/"><cite>Web IDL Standard</cite></a>. Edgar Chen; Timothy Gu. WHATWG. Living Standard. URL: <a href="https://webidl.spec.whatwg.org/">https://webidl.spec.whatwg.org/</a>
<a href="#ref-for-dfn-viewport-9" title="§ C. Element displayedness">§ C. Element displayedness</a>
24018
+
<a href="#ref-for-dfn-viewport-4" title="§ C. Element displayedness">§ C. Element displayedness</a>
24018
24019
</li>
24019
24020
</ul>
24020
24021
</div><div class="dfn-panel" hidden="" role="dialog" aria-modal="true" id="dfn-panel-for-dfn-display" aria-label="Links in this document to definition: display">
</div><div class="dfn-panel" hidden="" role="dialog" aria-modal="true" id="dfn-panel-for-dfn-visual-viewport" aria-label="Links in this document to definition: visual viewport">
24312
+
<span class="caret"></span>
24313
+
<div>
24314
+
<a class="self-link" href="#dfn-visual-viewport" aria-label="Permalink for definition: visual viewport. Activate to close this dialog.">Permalink</a>
</div><div class="dfn-panel" hidden="" role="dialog" aria-modal="true" id="dfn-panel-for-dfn-media-type" aria-label="Links in this document to definition: media type">
0 commit comments