CINXE.COM
CSSOM View Module
<!doctype html><html lang="en"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title>CSSOM View Module</title> <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"> <meta content="revising" name="csswg-work-status"> <meta content="WD" name="w3c-status"> <link href="default.css" rel="stylesheet" type="text/css"> <link href="https://www.w3.org/StyleSheets/TR/2016/W3C-WD" rel="stylesheet" type="text/css"> <meta content="Bikeshed 1.0.0" name="generator"> <style> .dfn-panel { display: inline-block; position: absolute; z-index: 35; height: auto; width: -webkit-fit-content; max-width: 300px; max-height: 500px; overflow: auto; padding: 0.5em 0.75em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: #DDDDDD; color: black; border: outset 0.2em; } .dfn-panel:not(.on) { display: none; } .dfn-panel * { margin: 0; padding: 0; text-indent: 0; } .dfn-panel > b { display: block; } .dfn-panel a { color: black; } .dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; } .dfn-panel > b + b { margin-top: 0.25em; } .dfn-panel > span { display: list-item; list-style: inside; } .dfn-panel.activated { display: inline-block; position: fixed; left: .5em; bottom: .5em; margin: 0 auto; max-width: calc(100vw - 1.5em - .4em - .5em); max-height: 30vh; } .dfn-paneled { cursor: pointer; } </style> <style>.highlight .hll { background-color: #ffffcc } .highlight { background: #ffffff; } .highlight .c { color: #708090 } /* Comment */ .highlight .k { color: #990055 } /* Keyword */ .highlight .l { color: #000000 } /* Literal */ .highlight .n { color: #0077aa } /* Name */ .highlight .o { color: #999999 } /* Operator */ .highlight .p { color: #999999 } /* Punctuation */ .highlight .cm { color: #708090 } /* Comment.Multiline */ .highlight .cp { color: #708090 } /* Comment.Preproc */ .highlight .c1 { color: #708090 } /* Comment.Single */ .highlight .cs { color: #708090 } /* Comment.Special */ .highlight .kc { color: #990055 } /* Keyword.Constant */ .highlight .kd { color: #990055 } /* Keyword.Declaration */ .highlight .kn { color: #990055 } /* Keyword.Namespace */ .highlight .kp { color: #990055 } /* Keyword.Pseudo */ .highlight .kr { color: #990055 } /* Keyword.Reserved */ .highlight .kt { color: #990055 } /* Keyword.Type */ .highlight .ld { color: #000000 } /* Literal.Date */ .highlight .m { color: #000000 } /* Literal.Number */ .highlight .s { color: #a67f59 } /* Literal.String */ .highlight .na { color: #0077aa } /* Name.Attribute */ .highlight .nc { color: #0077aa } /* Name.Class */ .highlight .no { color: #0077aa } /* Name.Constant */ .highlight .nd { color: #0077aa } /* Name.Decorator */ .highlight .ni { color: #0077aa } /* Name.Entity */ .highlight .ne { color: #0077aa } /* Name.Exception */ .highlight .nf { color: #0077aa } /* Name.Function */ .highlight .nl { color: #0077aa } /* Name.Label */ .highlight .nn { color: #0077aa } /* Name.Namespace */ .highlight .py { color: #0077aa } /* Name.Property */ .highlight .nt { color: #669900 } /* Name.Tag */ .highlight .nv { color: #0077aa } /* Name.Variable */ .highlight .ow { color: #999999 } /* Operator.Word */ .highlight .mb { color: #000000 } /* Literal.Number.Bin */ .highlight .mf { color: #000000 } /* Literal.Number.Float */ .highlight .mh { color: #000000 } /* Literal.Number.Hex */ .highlight .mi { color: #000000 } /* Literal.Number.Integer */ .highlight .mo { color: #000000 } /* Literal.Number.Oct */ .highlight .sb { color: #a67f59 } /* Literal.String.Backtick */ .highlight .sc { color: #a67f59 } /* Literal.String.Char */ .highlight .sd { color: #a67f59 } /* Literal.String.Doc */ .highlight .s2 { color: #a67f59 } /* Literal.String.Double */ .highlight .se { color: #a67f59 } /* Literal.String.Escape */ .highlight .sh { color: #a67f59 } /* Literal.String.Heredoc */ .highlight .si { color: #a67f59 } /* Literal.String.Interpol */ .highlight .sx { color: #a67f59 } /* Literal.String.Other */ .highlight .sr { color: #a67f59 } /* Literal.String.Regex */ .highlight .s1 { color: #a67f59 } /* Literal.String.Single */ .highlight .ss { color: #a67f59 } /* Literal.String.Symbol */ .highlight .vc { color: #0077aa } /* Name.Variable.Class */ .highlight .vg { color: #0077aa } /* Name.Variable.Global */ .highlight .vi { color: #0077aa } /* Name.Variable.Instance */ .highlight .il { color: #000000 } /* Literal.Number.Integer.Long */ .highlight { background: hsl(24, 20%, 95%); } code.highlight { padding: .1em; border-radius: .3em; } pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; } </style> <body class="h-entry"> <div class="head"> <p data-fill-with="logo"><a href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p> <h1 class="p-name no-ref" id="title">CSSOM View Module</h1> <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">W3C Working Draft, <time class="dt-updated" datetime="2016-03-17">17 March 2016</time></span></h2> <div data-fill-with="spec-metadata"> <dl> <dt>This version: <dd><a class="u-url" href="https://www.w3.org/TR/2016/WD-cssom-view-1-20160317/">http://www.w3.org/TR/2016/WD-cssom-view-1-20160317/</a> <dt>Latest version: <dd><a href="https://www.w3.org/TR/cssom-view-1/">http://www.w3.org/TR/cssom-view-1/</a> <dt>Editor's Draft: <dd><a href="https://drafts.csswg.org/cssom-view/">https://drafts.csswg.org/cssom-view/</a> <dt>Previous Versions: <dd><a href="https://www.w3.org/TR/2013/WD-cssom-view-20131217/" rel="previous">http://www.w3.org/TR/2013/WD-cssom-view-20131217/</a> <dd><a href="https://www.w3.org/TR/2011/WD-cssom-view-20110804/" rel="previous">http://www.w3.org/TR/2011/WD-cssom-view-20110804/</a> <dd><a href="https://www.w3.org/TR/2009/WD-cssom-view-20090804/" rel="previous">http://www.w3.org/TR/2009/WD-cssom-view-20090804/</a> <dd><a href="https://www.w3.org/TR/2008/WD-cssom-view-20080222/" rel="previous">http://www.w3.org/TR/2008/WD-cssom-view-20080222/</a> <dd><a href="https://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/" rel="previous">http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/</a> <dt>Feedback: <dd><span><a href="mailto:www-style@w3.org?subject=%5Bcssom-view%5D%20YOUR%20TOPIC%20HERE">www-style@w3.org</a> with subject line “<kbd>[cssom-view] <i data-lt="">… message topic …</i></kbd>” (<a href="http://lists.w3.org/Archives/Public/www-style/" rel="discussion">archives</a>)</span> <dt>Test Suite: <dd><a href="http://test.csswg.org/suites/cssom-view-1_dev/nightly-unstable/">http://test.csswg.org/suites/cssom-view-1_dev/nightly-unstable/</a> <dt>Issue Tracking: <dd><a href="#issues-index">Inline In Spec</a> <dt class="editor">Editor: <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:simonp@opera.com">Simon Pieters</a> (<a class="p-org org" href="http://www.opera.com">Opera Software ASA</a>) <dt class="editor">Former Editors: <dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="https://www.w3.org/wiki/User:Gadams">Glenn Adams</a> (<a class="p-org org" href="http://www.cox.com">Cox Communications, Inc.</a>) <a class="u-email email" href="mailto:glenn.adams@cos.com">glenn.adams@cos.com</a> <dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="https://annevankesteren.nl/">Anne van Kesteren</a> (<a class="p-org org" href="http://www.opera.com">Opera Software ASA</a>) <a class="u-email email" href="mailto:annevk@annevk.nl">annevk@annevk.nl</a> <dt>Issues list: <dd><span><a href="https://www.w3.org/Bugs/Public/buglist.cgi?product=CSS&component=CSSOM%20View&resolution=---">Bugzilla</a> (<a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=CSS&component=CSSOM%20View">file a bug</a>)</span> </dl> </div> <div data-fill-with="warning"></div> <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2016 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply. </p> <hr title="Separator for header"> </div> <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2> <div class="p-summary" data-fill-with="abstract"> <p>The APIs introduced by this specification provide authors with a way to inspect and manipulate the visual view of a document. This includes getting the position of element layout boxes, obtaining the width of the viewport through script, and also scrolling an element.</p> <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, in speech, etc. </div> <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2> <div data-fill-with="status"> <p><em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href="https://www.w3.org/TR/">W3C technical reports index at http://www.w3.org/TR/.</a></em> </p> <p>Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress. </p> <p>The (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public mailing list <a href="mailto:www-style@w3.org">www-style@w3.org</a> (see <a href="https://www.w3.org/Mail/Request">instructions</a>) is preferred for discussion of this specification. When sending e-mail, please put the text “cssom-view” in the subject, preferably like this: “[cssom-view] <em>…summary of comment…</em>” </p> <p>This document was produced by the <a href="https://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of the <a href="https://www.w3.org/Style/">Style Activity</a>). </p> <p>This document was produced by a group operating under the <a href="https://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>.</p> <p>This document is governed by the <a href="https://www.w3.org/2015/Process-20150901/" id="w3c_process_revision">1 September 2015 W3C Process Document</a>. </p> <p></p> </div> <div data-fill-with="at-risk"></div> <nav data-fill-with="table-of-contents" id="toc"> <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2> <ol class="toc" role="directory"> <li><a href="#background"><span class="secno">1</span> <span class="content">Background</span></a> <li> <a href="#terminology"><span class="secno">2</span> <span class="content">Terminology</span></a> <ol class="toc"> <li><a href="#css-pixels"><span class="secno">2.1</span> <span class="content">CSS pixels</span></a> <li><a href="#zooming"><span class="secno">2.2</span> <span class="content">Zooming</span></a> </ol> <li> <a href="#common-infrastructure"><span class="secno">3</span> <span class="content">Common Infrastructure</span></a> <ol class="toc"> <li><a href="#scrolling"><span class="secno">3.1</span> <span class="content">Scrolling</span></a> <li><a href="#webidl-values"><span class="secno">3.2</span> <span class="content">WebIDL values</span></a> </ol> <li> <a href="#extensions-to-the-window-interface"><span class="secno">4</span> <span class="content">Extensions to the <code class="idl"><span>Window</span></code> Interface</span></a> <ol class="toc"> <li><a href="#the-features-argument-to-the-open()-method"><span class="secno">4.1</span> <span class="content">The <var>features</var> argument to the <code class="idl"><span>open()</span></code> method</span></a> <li> <a href="#the-mediaquerylist-interface"><span class="secno">4.2</span> <span class="content">The <code class="idl"><span>MediaQueryList</span></code> Interface</span></a> <ol class="toc"> <li><a href="#mediaquerylist-event-summary"><span class="secno">4.2.1</span> <span class="content">Event summary</span></a> </ol> <li><a href="#the-screen-interface"><span class="secno">4.3</span> <span class="content">The <code class="idl"><span>Screen</span></code> Interface</span></a> </ol> <li> <a href="#extensions-to-the-document-interface"><span class="secno">5</span> <span class="content">Extensions to the <code class="idl"><span>Document</span></code> Interface</span></a> <ol class="toc"> <li><a href="#the-caretposition-interface"><span class="secno">5.1</span> <span class="content">The <code class="idl"><span>CaretPosition</span></code> Interface</span></a> </ol> <li> <a href="#extension-to-the-element-interface"><span class="secno">6</span> <span class="content">Extensions to the <code class="idl"><span>Element</span></code> Interface</span></a> <ol class="toc"> <li><a href="#element-scrolling-members"><span class="secno">6.1</span> <span class="content"><code class="idl"><span>Element</span></code> Scrolling Members</span></a> </ol> <li><a href="#extensions-to-the-htmlelement-interface"><span class="secno">7</span> <span class="content">Extensions to the <code class="idl"><span>HTMLElement</span></code> Interface</span></a> <li><a href="#extensions-to-the-htmlimageelement-interface"><span class="secno">8</span> <span class="content">Extensions to the <code class="idl"><span>HTMLImageElement</span></code> Interface</span></a> <li><a href="#extensions-to-the-range-interface"><span class="secno">9</span> <span class="content">Extensions to the <code class="idl"><span>Range</span></code> Interface</span></a> <li><a href="#extensions-to-the-mouseevent-interface"><span class="secno">10</span> <span class="content">Extensions to the <code class="idl"><span>MouseEvent</span></code> Interface</span></a> <li> <a href="#geometry"><span class="secno">11</span> <span class="content">Geometry</span></a> <ol class="toc"> <li><a href="#the-geometryutils-interface"><span class="secno">11.1</span> <span class="content">The <code class="idl"><span>GeometryUtils</span></code> Interface</span></a> </ol> <li> <a href="#events"><span class="secno">12</span> <span class="content">Events</span></a> <ol class="toc"> <li><a href="#resizing-viewports"><span class="secno">12.1</span> <span class="content">Resizing viewports</span></a> <li><a href="#scrolling-events"><span class="secno">12.2</span> <span class="content">Scrolling</span></a> <li><a href="#event-summary"><span class="secno">12.3</span> <span class="content">Event summary</span></a> </ol> <li> <a href="#css-properties"><span class="secno">13</span> <span class="content">CSS properties</span></a> <ol class="toc"> <li><a href="#smooth-scrolling"><span class="secno">13.1</span> <span class="content">Smooth Scrolling: The <span class="property">scroll-behavior</span> Property</span></a> </ol> <li> <a href="#change-history"><span class="secno"></span> <span class="content">Change History</span></a> <ol class="toc"> <li><a href="#changes-from-2013-12-17"><span class="secno"></span> <span class="content">Changes From 17 December 2013</span></a> <li><a href="#changes-from-2011-08-04"><span class="secno"></span> <span class="content">Changes From 4 August 2011 To 17 December 2013</span></a> </ol> <li><a href="#acks"><span class="secno"></span> <span class="content">Acknowledgments</span></a> <li> <a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a> <ol class="toc"> <li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a> <li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a> <li> <a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a> <ol class="toc"> <li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a> <li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a> <li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a> </ol> </ol> <li> <a href="#index"><span class="secno"></span> <span class="content">Index</span></a> <ol class="toc"> <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a> <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a> </ol> <li> <a href="#references"><span class="secno"></span> <span class="content">References</span></a> <ol class="toc"> <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a> <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a> </ol> <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a> <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a> <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a> </ol> </nav> <main> <script async="" src="https://resources.whatwg.org/file-bug.js"></script> <h2 class="heading settled" data-level="1" id="background"><span class="secno">1. </span><span class="content">Background</span><a class="self-link" href="#background"></a></h2> <p>Many of the features defined in this specification have been supported by browsers for a long period of time. The goal of this specification is to define these features in such a way that they can be implemented by all browsers in an interoperable manner. The specification also defines a couple of new features that will hopefully be useful to authors. (If they are not you can bug us!)</p> <h2 class="heading settled" data-level="2" id="terminology"><span class="secno">2. </span><span class="content">Terminology</span><a class="self-link" href="#terminology"></a></h2> <p>Terminology used in this specification is from DOM, CSSOM and HTML. <a data-link-type="biblio" href="#biblio-whatwg-dom">[DOM]</a> <a data-link-type="biblio" href="#biblio-cssom">[CSSOM]</a> <a data-link-type="biblio" href="#biblio-html">[HTML]</a></p> <p><dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="The HTML body element" data-noexport="" id="the-html-body-element">The HTML <code>body</code> element<span class="dfn-panel" data-deco=""><b><a href="#the-html-body-element">#the-html-body-element</a></b><b>Referenced in:</b><span><a href="#ref-for-the-html-body-element-1">2. Terminology</a></span><span><a href="#ref-for-the-html-body-element-2">5. Extensions to the Document Interface</a> <a href="#ref-for-the-html-body-element-3">(2)</a> <a href="#ref-for-the-html-body-element-4">(3)</a> <a href="#ref-for-the-html-body-element-5">(4)</a></span><span><a href="#ref-for-the-html-body-element-6">6. Extensions to the Element Interface</a> <a href="#ref-for-the-html-body-element-7">(2)</a> <a href="#ref-for-the-html-body-element-8">(3)</a> <a href="#ref-for-the-html-body-element-9">(4)</a> <a href="#ref-for-the-html-body-element-10">(5)</a> <a href="#ref-for-the-html-body-element-11">(6)</a> <a href="#ref-for-the-html-body-element-12">(7)</a> <a href="#ref-for-the-html-body-element-13">(8)</a> <a href="#ref-for-the-html-body-element-14">(9)</a></span><span><a href="#ref-for-the-html-body-element-15">7. Extensions to the HTMLElement Interface</a> <a href="#ref-for-the-html-body-element-16">(2)</a> <a href="#ref-for-the-html-body-element-17">(3)</a> <a href="#ref-for-the-html-body-element-18">(4)</a></span></span></dfn> is the first <code>body</code> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#html-elements">HTML element</a> child of the root <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#html-elements">HTML element</a> <code>html</code>.</p> <p><dfn data-dfn-type="dfn" data-noexport="" id="content-edge">Content edge<a class="self-link" href="#content-edge"></a></dfn>, <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="padding edge" data-noexport="" id="padding-edge">padding edge<span class="dfn-panel" data-deco=""><b><a href="#padding-edge">#padding-edge</a></b><b>Referenced in:</b><span><a href="#ref-for-padding-edge-1">2. Terminology</a> <a href="#ref-for-padding-edge-2">(2)</a> <a href="#ref-for-padding-edge-3">(3)</a> <a href="#ref-for-padding-edge-4">(4)</a> <a href="#ref-for-padding-edge-5">(5)</a> <a href="#ref-for-padding-edge-6">(6)</a> <a href="#ref-for-padding-edge-7">(7)</a> <a href="#ref-for-padding-edge-8">(8)</a> <a href="#ref-for-padding-edge-9">(9)</a> <a href="#ref-for-padding-edge-10">(10)</a> <a href="#ref-for-padding-edge-11">(11)</a> <a href="#ref-for-padding-edge-12">(12)</a> <a href="#ref-for-padding-edge-13">(13)</a> <a href="#ref-for-padding-edge-14">(14)</a> <a href="#ref-for-padding-edge-15">(15)</a> <a href="#ref-for-padding-edge-16">(16)</a></span><span><a href="#ref-for-padding-edge-17">6. Extensions to the Element Interface</a> <a href="#ref-for-padding-edge-18">(2)</a> <a href="#ref-for-padding-edge-19">(3)</a> <a href="#ref-for-padding-edge-20">(4)</a> <a href="#ref-for-padding-edge-21">(5)</a> <a href="#ref-for-padding-edge-22">(6)</a> <a href="#ref-for-padding-edge-23">(7)</a> <a href="#ref-for-padding-edge-24">(8)</a></span><span><a href="#ref-for-padding-edge-25">6.1. Element Scrolling Members</a> <a href="#ref-for-padding-edge-26">(2)</a> <a href="#ref-for-padding-edge-27">(3)</a> <a href="#ref-for-padding-edge-28">(4)</a></span><span><a href="#ref-for-padding-edge-29">7. Extensions to the HTMLElement Interface</a> <a href="#ref-for-padding-edge-30">(2)</a></span><span><a href="#ref-for-padding-edge-31">10. Extensions to the MouseEvent Interface</a> <a href="#ref-for-padding-edge-32">(2)</a></span></span></dfn>, <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="border edge" data-noexport="" id="border-edge">border edge<span class="dfn-panel" data-deco=""><b><a href="#border-edge">#border-edge</a></b><b>Referenced in:</b><span><a href="#ref-for-border-edge-1">6. Extensions to the Element Interface</a> <a href="#ref-for-border-edge-2">(2)</a> <a href="#ref-for-border-edge-3">(3)</a> <a href="#ref-for-border-edge-4">(4)</a></span><span><a href="#ref-for-border-edge-5">7. Extensions to the HTMLElement Interface</a> <a href="#ref-for-border-edge-6">(2)</a> <a href="#ref-for-border-edge-7">(3)</a> <a href="#ref-for-border-edge-8">(4)</a> <a href="#ref-for-border-edge-9">(5)</a> <a href="#ref-for-border-edge-10">(6)</a></span><span><a href="#ref-for-border-edge-11">8. Extensions to the HTMLImageElement Interface</a> <a href="#ref-for-border-edge-12">(2)</a></span></span></dfn>, <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="margin edge" data-noexport="" id="margin-edge">margin edge<span class="dfn-panel" data-deco=""><b><a href="#margin-edge">#margin-edge</a></b><b>Referenced in:</b><span><a href="#ref-for-margin-edge-1">2. Terminology</a> <a href="#ref-for-margin-edge-2">(2)</a> <a href="#ref-for-margin-edge-3">(3)</a> <a href="#ref-for-margin-edge-4">(4)</a> <a href="#ref-for-margin-edge-5">(5)</a> <a href="#ref-for-margin-edge-6">(6)</a> <a href="#ref-for-margin-edge-7">(7)</a> <a href="#ref-for-margin-edge-8">(8)</a> <a href="#ref-for-margin-edge-9">(9)</a> <a href="#ref-for-margin-edge-10">(10)</a> <a href="#ref-for-margin-edge-11">(11)</a> <a href="#ref-for-margin-edge-12">(12)</a> <a href="#ref-for-margin-edge-13">(13)</a> <a href="#ref-for-margin-edge-14">(14)</a> <a href="#ref-for-margin-edge-15">(15)</a> <a href="#ref-for-margin-edge-16">(16)</a></span></span></dfn>, and <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="viewport" data-noexport="" id="viewport">viewport<span class="dfn-panel" data-deco=""><b><a href="#viewport">#viewport</a></b><b>Referenced in:</b><span><a href="#ref-for-viewport-1">2. Terminology</a> <a href="#ref-for-viewport-2">(2)</a> <a href="#ref-for-viewport-3">(3)</a> <a href="#ref-for-viewport-4">(4)</a> <a href="#ref-for-viewport-5">(5)</a> <a href="#ref-for-viewport-6">(6)</a> <a href="#ref-for-viewport-7">(7)</a> <a href="#ref-for-viewport-8">(8)</a> <a href="#ref-for-viewport-9">(9)</a> <a href="#ref-for-viewport-10">(10)</a> <a href="#ref-for-viewport-11">(11)</a> <a href="#ref-for-viewport-12">(12)</a> <a href="#ref-for-viewport-13">(13)</a> <a href="#ref-for-viewport-14">(14)</a> <a href="#ref-for-viewport-15">(15)</a></span><span><a href="#ref-for-viewport-16">3.1. Scrolling</a></span><span><a href="#ref-for-viewport-17">4. Extensions to the Window Interface</a> <a href="#ref-for-viewport-18">(2)</a> <a href="#ref-for-viewport-19">(3)</a> <a href="#ref-for-viewport-20">(4)</a> <a href="#ref-for-viewport-21">(5)</a> <a href="#ref-for-viewport-22">(6)</a> <a href="#ref-for-viewport-23">(7)</a> <a href="#ref-for-viewport-24">(8)</a> <a href="#ref-for-viewport-25">(9)</a> <a href="#ref-for-viewport-26">(10)</a> <a href="#ref-for-viewport-27">(11)</a> <a href="#ref-for-viewport-28">(12)</a> <a href="#ref-for-viewport-29">(13)</a> <a href="#ref-for-viewport-30">(14)</a> <a href="#ref-for-viewport-31">(15)</a> <a href="#ref-for-viewport-32">(16)</a> <a href="#ref-for-viewport-33">(17)</a> <a href="#ref-for-viewport-34">(18)</a> <a href="#ref-for-viewport-35">(19)</a> <a href="#ref-for-viewport-36">(20)</a> <a href="#ref-for-viewport-37">(21)</a> <a href="#ref-for-viewport-38">(22)</a> <a href="#ref-for-viewport-39">(23)</a> <a href="#ref-for-viewport-40">(24)</a> <a href="#ref-for-viewport-41">(25)</a> <a href="#ref-for-viewport-42">(26)</a> <a href="#ref-for-viewport-43">(27)</a> <a href="#ref-for-viewport-44">(28)</a> <a href="#ref-for-viewport-45">(29)</a> <a href="#ref-for-viewport-46">(30)</a></span><span><a href="#ref-for-viewport-47">5. Extensions to the Document Interface</a> <a href="#ref-for-viewport-48">(2)</a> <a href="#ref-for-viewport-49">(3)</a> <a href="#ref-for-viewport-50">(4)</a> <a href="#ref-for-viewport-51">(5)</a> <a href="#ref-for-viewport-52">(6)</a> <a href="#ref-for-viewport-53">(7)</a> <a href="#ref-for-viewport-54">(8)</a> <a href="#ref-for-viewport-55">(9)</a> <a href="#ref-for-viewport-56">(10)</a> <a href="#ref-for-viewport-57">(11)</a> <a href="#ref-for-viewport-58">(12)</a> <a href="#ref-for-viewport-59">(13)</a> <a href="#ref-for-viewport-60">(14)</a> <a href="#ref-for-viewport-61">(15)</a> <a href="#ref-for-viewport-62">(16)</a> <a href="#ref-for-viewport-63">(17)</a> <a href="#ref-for-viewport-64">(18)</a></span><span><a href="#ref-for-viewport-65">6. Extensions to the Element Interface</a> <a href="#ref-for-viewport-66">(2)</a> <a href="#ref-for-viewport-67">(3)</a> <a href="#ref-for-viewport-68">(4)</a> <a href="#ref-for-viewport-69">(5)</a> <a href="#ref-for-viewport-70">(6)</a> <a href="#ref-for-viewport-71">(7)</a> <a href="#ref-for-viewport-72">(8)</a> <a href="#ref-for-viewport-73">(9)</a> <a href="#ref-for-viewport-74">(10)</a></span><span><a href="#ref-for-viewport-75">6.1. Element Scrolling Members</a> <a href="#ref-for-viewport-76">(2)</a> <a href="#ref-for-viewport-77">(3)</a> <a href="#ref-for-viewport-78">(4)</a></span><span><a href="#ref-for-viewport-79">10. Extensions to the MouseEvent Interface</a> <a href="#ref-for-viewport-80">(2)</a></span><span><a href="#ref-for-viewport-81">12.1. Resizing viewports</a></span><span><a href="#ref-for-viewport-82">12.2. Scrolling</a> <a href="#ref-for-viewport-83">(2)</a></span><span><a href="#ref-for-viewport-84">12.3. Event summary</a> <a href="#ref-for-viewport-85">(2)</a></span><span><a href="#ref-for-viewport-86">13.1. Smooth Scrolling: The scroll-behavior Property</a></span></span></dfn> are defined by CSS.</p> <p>Elements and <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-1">viewports</a> have an associated <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="scrolling box" data-noexport="" id="scrolling-box">scrolling box<span class="dfn-panel" data-deco=""><b><a href="#scrolling-box">#scrolling-box</a></b><b>Referenced in:</b><span><a href="#ref-for-scrolling-box-1">2. Terminology</a> <a href="#ref-for-scrolling-box-2">(2)</a> <a href="#ref-for-scrolling-box-3">(3)</a></span><span><a href="#ref-for-scrolling-box-4">3.1. Scrolling</a> <a href="#ref-for-scrolling-box-5">(2)</a> <a href="#ref-for-scrolling-box-6">(3)</a></span><span><a href="#ref-for-scrolling-box-7">6. Extensions to the Element Interface</a> <a href="#ref-for-scrolling-box-8">(2)</a> <a href="#ref-for-scrolling-box-9">(3)</a></span><span><a href="#ref-for-scrolling-box-10">6.1. Element Scrolling Members</a> <a href="#ref-for-scrolling-box-11">(2)</a> <a href="#ref-for-scrolling-box-12">(3)</a></span><span><a href="#ref-for-scrolling-box-13">13.1. Smooth Scrolling: The scroll-behavior Property</a> <a href="#ref-for-scrolling-box-14">(2)</a> <a href="#ref-for-scrolling-box-15">(3)</a> <a href="#ref-for-scrolling-box-16">(4)</a></span></span></dfn> if has a scrolling mechanism or it overflows its content area and the used value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow-x">overflow-x</a> or <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow-y">overflow-y</a> property is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-4/#valdef-overflow-hidden">hidden</a>. <a data-link-type="biblio" href="#biblio-css3-box">[CSS3-BOX]</a></p> <p>An element is <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="potentially scrollable" data-noexport="" id="potentially-scrollable">potentially scrollable<span class="dfn-panel" data-deco=""><b><a href="#potentially-scrollable">#potentially-scrollable</a></b><b>Referenced in:</b><span><a href="#ref-for-potentially-scrollable-1">2. Terminology</a></span><span><a href="#ref-for-potentially-scrollable-2">5. Extensions to the Document Interface</a></span><span><a href="#ref-for-potentially-scrollable-3">6. Extensions to the Element Interface</a> <a href="#ref-for-potentially-scrollable-4">(2)</a> <a href="#ref-for-potentially-scrollable-5">(3)</a> <a href="#ref-for-potentially-scrollable-6">(4)</a> <a href="#ref-for-potentially-scrollable-7">(5)</a> <a href="#ref-for-potentially-scrollable-8">(6)</a> <a href="#ref-for-potentially-scrollable-9">(7)</a></span></span></dfn> if all of the following conditions are true:</p> <ul> <li data-md=""> <p>The element has an associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-1">CSS layout box</a>.</p> <li data-md=""> <p>The element is not <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-1">the HTML <code>body</code> element</a>, or it is and the root element’s used value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow-x">overflow-x</a> or <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow-y">overflow-y</a> properties is not <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-4/#valdef-overflow-visible">visible</a>.</p> <li data-md=""> <p>The element’s used value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow-x">overflow-x</a> or <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow-y">overflow-y</a> properties is not <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-4/#valdef-overflow-visible">visible</a>.</p> </ul> <p class="note" role="note">Note: An element that is <a data-link-type="dfn" href="#potentially-scrollable" id="ref-for-potentially-scrollable-1">potentially scrollable</a> might not have a <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-1">scrolling box</a>. For instance, it could have <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow">overflow</a> set to <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-4/#valdef-overflow-auto">auto</a> but not have its content overflowing its content area.</p> <p>A <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-2">scrolling box</a> of a <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-2">viewport</a> or element has two <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="overflow directions" data-noexport="" id="overflow-directions">overflow directions<span class="dfn-panel" data-deco=""><b><a href="#overflow-directions">#overflow-directions</a></b><b>Referenced in:</b><span><a href="#ref-for-overflow-directions-1">2. Terminology</a> <a href="#ref-for-overflow-directions-2">(2)</a> <a href="#ref-for-overflow-directions-3">(3)</a> <a href="#ref-for-overflow-directions-4">(4)</a> <a href="#ref-for-overflow-directions-5">(5)</a> <a href="#ref-for-overflow-directions-6">(6)</a> <a href="#ref-for-overflow-directions-7">(7)</a> <a href="#ref-for-overflow-directions-8">(8)</a> <a href="#ref-for-overflow-directions-9">(9)</a> <a href="#ref-for-overflow-directions-10">(10)</a></span><span><a href="#ref-for-overflow-directions-11">4. Extensions to the Window Interface</a> <a href="#ref-for-overflow-directions-12">(2)</a> <a href="#ref-for-overflow-directions-13">(3)</a> <a href="#ref-for-overflow-directions-14">(4)</a></span><span><a href="#ref-for-overflow-directions-15">6.1. Element Scrolling Members</a> <a href="#ref-for-overflow-directions-16">(2)</a> <a href="#ref-for-overflow-directions-17">(3)</a> <a href="#ref-for-overflow-directions-18">(4)</a></span></span></dfn>, depending on the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-3">viewport’s</a> or element’s <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> and <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a>, as follows:</p> <dl class="switch"> <dt>If the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> is top-to-bottom and the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a> is left-to-right <dt>If the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> is left-to-right and the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a> is left-to-right <dd>Rightward and downward. <dt>If the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> is top-to-bottom and the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a> is right-to-left <dt>If the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> is right-to-left and the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a> is left-to-right <dd>Leftward and downward. <dt>If the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> is right-to-left and the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a> is right-to-left <dd>Leftward and upward. <dt>If the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> is left-to-right and the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a> is right-to-left <dd>Rightward and upward. </dl> <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="scrolling area" data-noexport="" id="scrolling-area">scrolling area<span class="dfn-panel" data-deco=""><b><a href="#scrolling-area">#scrolling-area</a></b><b>Referenced in:</b><span><a href="#ref-for-scrolling-area-1">2. Terminology</a> <a href="#ref-for-scrolling-area-2">(2)</a></span><span><a href="#ref-for-scrolling-area-3">3.1. Scrolling</a></span><span><a href="#ref-for-scrolling-area-4">4. Extensions to the Window Interface</a> <a href="#ref-for-scrolling-area-5">(2)</a> <a href="#ref-for-scrolling-area-6">(3)</a> <a href="#ref-for-scrolling-area-7">(4)</a> <a href="#ref-for-scrolling-area-8">(5)</a> <a href="#ref-for-scrolling-area-9">(6)</a></span><span><a href="#ref-for-scrolling-area-10">6. Extensions to the Element Interface</a> <a href="#ref-for-scrolling-area-11">(2)</a> <a href="#ref-for-scrolling-area-12">(3)</a> <a href="#ref-for-scrolling-area-13">(4)</a> <a href="#ref-for-scrolling-area-14">(5)</a> <a href="#ref-for-scrolling-area-15">(6)</a> <a href="#ref-for-scrolling-area-16">(7)</a> <a href="#ref-for-scrolling-area-17">(8)</a></span><span><a href="#ref-for-scrolling-area-18">6.1. Element Scrolling Members</a> <a href="#ref-for-scrolling-area-19">(2)</a> <a href="#ref-for-scrolling-area-20">(3)</a> <a href="#ref-for-scrolling-area-21">(4)</a> <a href="#ref-for-scrolling-area-22">(5)</a> <a href="#ref-for-scrolling-area-23">(6)</a></span></span></dfn> refers to a box of a <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-4">viewport</a> or an element that has the following edges, depending on the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-5">viewport’s</a> or element’s <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-3">scrolling box’s</a> <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-1">overflow directions</a>.</p> <table class="complex data"> <thead> <tr> <th>If the <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-2">overflow directions</a> are… <th>For a <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-6">viewport</a> <th>For an element <tbody> <tr> <td>rightward and downward <td class="long"> <dl> <dt>top edge <dd>The top edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a>. <dt>right edge <dd>The right-most edge of the right edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> and the right <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-1">margin edge</a> of all of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-7">viewport’s</a> descendants' boxes. <dt>bottom edge <dd>The bottom-most edge of the bottom edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> and the bottom <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-2">margin edge</a> of all of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-8">viewport’s</a> descendants' boxes. <dt>left edge <dd>The left edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a>. </dl> <td class="long"> <dl> <dt>top edge <dd>The element’s top <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-1">padding edge</a>. <dt>right edge <dd>The right-most edge of the element’s right <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-2">padding edge</a> and the right <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-3">margin edge</a> of all of the element’s descendants' boxes, excluding boxes that have an ancestor of the element as their containing block. <dt>bottom edge <dd>The bottom-most edge of the element’s bottom <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-3">padding edge</a> and the bottom <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-4">margin edge</a> of all of the element’s descendants' boxes, excluding boxes that have an ancestor of the element as their containing block. <dt>left edge <dd>The element’s left <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-4">padding edge</a>. </dl> <tr> <td>leftward and downward <td class="long"> <dl> <dt>top edge <dd>The top edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a>. <dt>right edge <dd>The right edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a>. <dt>bottom edge <dd>The bottom-most edge of the bottom edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> and the bottom <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-5">margin edge</a> of all of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-9">viewport’s</a> descendants' boxes. <dt>left edge <dd>The left-most edge of the left edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> and the left <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-6">margin edge</a> of all of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-10">viewport’s</a> descendants' boxes. </dl> <td class="long"> <dl> <dt>top edge <dd>The element’s top <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-5">padding edge</a>. <dt>right edge <dd>The element’s right <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-6">padding edge</a>. <dt>bottom edge <dd>The bottom-most edge of the element’s bottom <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-7">padding edge</a> and the bottom <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-7">margin edge</a> of all of the element’s descendants' boxes, excluding boxes that have an ancestor of the element as their containing block. <dt>left edge <dd>The left-most edge of the element’s left <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-8">padding edge</a> and the left <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-8">margin edge</a> of all of the element’s descendants' boxes, excluding boxes that have an ancestor of the element as their containing block. </dl> <tr> <td>leftward and upward <td class="long"> <dl> <dt>top edge <dd>The top-most edge of the top edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> and the top <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-9">margin edge</a> of all of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-11">viewport’s</a> descendants' boxes. <dt>right edge <dd>The right edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a>. <dt>bottom edge <dd>The bottom edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a>. <dt>left edge <dd>The left-most edge of the left edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> and the left <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-10">margin edge</a> of all of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-12">viewport’s</a> descendants' boxes. </dl> <td class="long"> <dl> <dt>top edge <dd>The top-most edge of the element’s top <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-9">padding edge</a> and the top <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-11">margin edge</a> of all of the element’s descendants' boxes, excluding boxes that have an ancestor of the element as their containing block. <dt>right edge <dd>The element’s right <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-10">padding edge</a>. <dt>bottom edge <dd>The element’s bottom <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-11">padding edge</a>. <dt>left edge <dd>The left-most edge of the element’s left <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-12">padding edge</a> and the left <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-12">margin edge</a> of all of the element’s descendants' boxes, excluding boxes that have an ancestor of the element as their containing block. </dl> <tr> <td>rightward and upward <td class="long"> <dl> <dt>top edge <dd>The top-most edge of the top edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> and the top <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-13">margin edge</a> of all of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-13">viewport’s</a> descendants' boxes. <dt>right edge <dd>The right-most edge of the right edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> and the right <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-14">margin edge</a> of all of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-14">viewport’s</a> descendants' boxes. <dt>bottom edge <dd>The bottom edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a>. <dt>left edge <dd>The left edge of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a>. </dl> <td class="long"> <dl> <dt>top edge <dd>The top-most edge of the element’s top <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-13">padding edge</a> and the top <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-15">margin edge</a> of all of the element’s descendants' boxes, excluding boxes that have an ancestor of the element as their containing block. <dt>right edge <dd>The right-most edge of the element’s right <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-14">padding edge</a> and the right <a data-link-type="dfn" href="#margin-edge" id="ref-for-margin-edge-16">margin edge</a> of all of the element’s descendants' boxes, excluding boxes that have an ancestor of the element as their containing block. <dt>bottom edge <dd>The element’s bottom <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-15">padding edge</a>. <dt>left edge <dd>The element’s left <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-16">padding edge</a>. </dl> </table> <p>The <dfn data-dfn-type="dfn" data-lt="scrolling area origin" data-noexport="" id="scrolling-area-origin">origin<a class="self-link" href="#scrolling-area-origin"></a></dfn> of a <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-1">scrolling area</a> is the origin of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> if the <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-2">scrolling area</a> is a <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-15">viewport</a>, and otherwise the top left padding edge of the element when the element has its default scroll position. The x-coordinate increases rightwards, and the y-coordinate increases downwards.</p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="beginning edges" data-noexport="" id="beginning-edges">beginning edges<span class="dfn-panel" data-deco=""><b><a href="#beginning-edges">#beginning-edges</a></b><b>Referenced in:</b><span><a href="#ref-for-beginning-edges-1">3.1. Scrolling</a> <a href="#ref-for-beginning-edges-2">(2)</a></span><span><a href="#ref-for-beginning-edges-3">6.1. Element Scrolling Members</a> <a href="#ref-for-beginning-edges-4">(2)</a></span></span></dfn> of a particular set of edges of a box or element are the following edges:</p> <dl class="switch"> <dt>If the <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-3">overflow directions</a> are rightward and downward <dd>The top and left edges. <dt>If the <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-4">overflow directions</a> are leftward and downward <dd>The top and right edges. <dt>If the <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-5">overflow directions</a> are leftward and upward <dd>The bottom and right edges. <dt>If the <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-6">overflow directions</a> are rightward and upward <dd>The bottom and left edges. </dl> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="ending edges" data-noexport="" id="ending-edges">ending edges<span class="dfn-panel" data-deco=""><b><a href="#ending-edges">#ending-edges</a></b><b>Referenced in:</b><span><a href="#ref-for-ending-edges-1">6.1. Element Scrolling Members</a> <a href="#ref-for-ending-edges-2">(2)</a></span></span></dfn> of a particular set of edges of a box or element are the following edges:</p> <dl class="switch"> <dt>If the <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-7">overflow directions</a> are rightward and downward <dd>The bottom and right edges. <dt>If the <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-8">overflow directions</a> are leftward and downward <dd>The bottom and left edges. <dt>If the <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-9">overflow directions</a> are leftward and upward <dd>The top and left edges. <dt>If the <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-10">overflow directions</a> are rightward and upward <dd>The top and right edges. </dl> <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="CSS layout box" data-noexport="" id="css-layout-box">CSS layout box<span class="dfn-panel" data-deco=""><b><a href="#css-layout-box">#css-layout-box</a></b><b>Referenced in:</b><span><a href="#ref-for-css-layout-box-1">2. Terminology</a> <a href="#ref-for-css-layout-box-2">(2)</a> <a href="#ref-for-css-layout-box-3">(3)</a> <a href="#ref-for-css-layout-box-4">(4)</a></span><span><a href="#ref-for-css-layout-box-5">6. Extensions to the Element Interface</a> <a href="#ref-for-css-layout-box-6">(2)</a> <a href="#ref-for-css-layout-box-7">(3)</a> <a href="#ref-for-css-layout-box-8">(4)</a> <a href="#ref-for-css-layout-box-9">(5)</a> <a href="#ref-for-css-layout-box-10">(6)</a> <a href="#ref-for-css-layout-box-11">(7)</a> <a href="#ref-for-css-layout-box-12">(8)</a> <a href="#ref-for-css-layout-box-13">(9)</a> <a href="#ref-for-css-layout-box-14">(10)</a> <a href="#ref-for-css-layout-box-15">(11)</a> <a href="#ref-for-css-layout-box-16">(12)</a> <a href="#ref-for-css-layout-box-17">(13)</a> <a href="#ref-for-css-layout-box-18">(14)</a> <a href="#ref-for-css-layout-box-19">(15)</a></span><span><a href="#ref-for-css-layout-box-20">7. Extensions to the HTMLElement Interface</a> <a href="#ref-for-css-layout-box-21">(2)</a> <a href="#ref-for-css-layout-box-22">(3)</a> <a href="#ref-for-css-layout-box-23">(4)</a> <a href="#ref-for-css-layout-box-24">(5)</a> <a href="#ref-for-css-layout-box-25">(6)</a> <a href="#ref-for-css-layout-box-26">(7)</a> <a href="#ref-for-css-layout-box-27">(8)</a> <a href="#ref-for-css-layout-box-28">(9)</a> <a href="#ref-for-css-layout-box-29">(10)</a> <a href="#ref-for-css-layout-box-30">(11)</a> <a href="#ref-for-css-layout-box-31">(12)</a> <a href="#ref-for-css-layout-box-32">(13)</a> <a href="#ref-for-css-layout-box-33">(14)</a></span><span><a href="#ref-for-css-layout-box-34">8. Extensions to the HTMLImageElement Interface</a> <a href="#ref-for-css-layout-box-35">(2)</a> <a href="#ref-for-css-layout-box-36">(3)</a> <a href="#ref-for-css-layout-box-37">(4)</a></span></span></dfn> refers to the same term in CSS. For the purpose of the requirements in this specification, elements that have a computed value of the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/CSS21/visuren.html#propdef-display">display</a> property that is <a class="css" data-link-type="maybe" href="https://www.w3.org/TR/css-display-3/#valdef-display-table-column">table-column</a> or <a class="css" data-link-type="maybe" href="https://www.w3.org/TR/css-display-3/#valdef-display-table-column-group">table-column-group</a> must be considered to have an associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-2">CSS layout box</a> (the column or column group, respectively).</p> <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="SVG layout box" data-noexport="" id="svg-layout-box">SVG layout box<span class="dfn-panel" data-deco=""><b><a href="#svg-layout-box">#svg-layout-box</a></b><b>Referenced in:</b><span><a href="#ref-for-svg-layout-box-1">2. Terminology</a> <a href="#ref-for-svg-layout-box-2">(2)</a></span><span><a href="#ref-for-svg-layout-box-3">6. Extensions to the Element Interface</a></span></span></dfn> refers to the same term in SVG.</p> <p class="issue" id="issue-08afa5fa"><a class="self-link" href="#issue-08afa5fa"></a>The terms <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-3">CSS layout box</a> and <a data-link-type="dfn" href="#svg-layout-box" id="ref-for-svg-layout-box-1">SVG layout box</a> are not currently defined by CSS or SVG. </p> <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="layout box" data-noexport="" id="layout-box">layout box<span class="dfn-panel" data-deco=""><b><a href="#layout-box">#layout-box</a></b><b>Referenced in:</b><span><a href="#ref-for-layout-box-1">5. Extensions to the Document Interface</a> <a href="#ref-for-layout-box-2">(2)</a></span><span><a href="#ref-for-layout-box-3">6. Extensions to the Element Interface</a> <a href="#ref-for-layout-box-4">(2)</a></span></span></dfn> refers to either a <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-4">CSS layout box</a> or an <a data-link-type="dfn" href="#svg-layout-box" id="ref-for-svg-layout-box-2">SVG layout box</a>.</p> <p>The term <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="transforms" data-noexport="" id="transforms">transforms<span class="dfn-panel" data-deco=""><b><a href="#transforms">#transforms</a></b><b>Referenced in:</b><span><a href="#ref-for-transforms-1">5. Extensions to the Document Interface</a> <a href="#ref-for-transforms-2">(2)</a> <a href="#ref-for-transforms-3">(3)</a> <a href="#ref-for-transforms-4">(4)</a> <a href="#ref-for-transforms-5">(5)</a></span><span><a href="#ref-for-transforms-6">5.1. The CaretPosition Interface</a></span><span><a href="#ref-for-transforms-7">6. Extensions to the Element Interface</a> <a href="#ref-for-transforms-8">(2)</a> <a href="#ref-for-transforms-9">(3)</a> <a href="#ref-for-transforms-10">(4)</a> <a href="#ref-for-transforms-11">(5)</a> <a href="#ref-for-transforms-12">(6)</a></span><span><a href="#ref-for-transforms-13">7. Extensions to the HTMLElement Interface</a> <a href="#ref-for-transforms-14">(2)</a> <a href="#ref-for-transforms-15">(3)</a> <a href="#ref-for-transforms-16">(4)</a> <a href="#ref-for-transforms-17">(5)</a> <a href="#ref-for-transforms-18">(6)</a></span><span><a href="#ref-for-transforms-19">8. Extensions to the HTMLImageElement Interface</a> <a href="#ref-for-transforms-20">(2)</a></span><span><a href="#ref-for-transforms-21">9. Extensions to the Range Interface</a></span><span><a href="#ref-for-transforms-22">10. Extensions to the MouseEvent Interface</a> <a href="#ref-for-transforms-23">(2)</a></span><span><a href="#ref-for-transforms-24">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> refers to SVG transforms and CSS transforms. <a data-link-type="biblio" href="#biblio-svg">[SVG]</a> <a data-link-type="biblio" href="#biblio-css-transforms-1">[CSS-TRANSFORMS-1]</a></p> <p>When a method or an attribute is said to call another method or attribute, the user agent must invoke its internal API for that attribute or method so that e.g. the author can’t change the behavior by overriding attributes or methods with custom properties or functions in ECMAScript.</p> <p>Unless otherwise stated, string comparisons are done in a <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#case-sensitive">case-sensitive</a> manner.</p> <h3 class="heading settled" data-level="2.1" id="css-pixels"><span class="secno">2.1. </span><span class="content">CSS pixels</span><a class="self-link" href="#css-pixels"></a></h3> <p>All coordinates and dimensions for the APIs defined in this specification are in CSS pixels, unless otherwise specified. </p> <p class="note" role="note">Note: This does not apply to e.g. <code class="idl"><a data-link-type="idl" href="#dom-window-matchmedia" id="ref-for-dom-window-matchmedia-1">matchMedia()</a></code> as the units are explicitly given there.</p> <h3 class="heading settled" data-level="2.2" id="zooming"><span class="secno">2.2. </span><span class="content">Zooming</span><a class="self-link" href="#zooming"></a></h3> <p>There are two kinds of zoom, <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="page zoom" data-noexport="" id="page-zoom">page zoom<span class="dfn-panel" data-deco=""><b><a href="#page-zoom">#page-zoom</a></b><b>Referenced in:</b><span><a href="#ref-for-page-zoom-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-page-zoom-2">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> which affects the size of the initial viewport, and <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="pinch zoom" data-noexport="" id="pinch-zoom">pinch zoom<span class="dfn-panel" data-deco=""><b><a href="#pinch-zoom">#pinch-zoom</a></b><b>Referenced in:</b><span><a href="#ref-for-pinch-zoom-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-pinch-zoom-2">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> which acts like a magnifying glass and does not affect the initial viewport or actual viewport. <a data-link-type="biblio" href="#biblio-css-device-adapt">[CSS-DEVICE-ADAPT]</a></p> <h2 class="heading settled" data-level="3" id="common-infrastructure"><span class="secno">3. </span><span class="content">Common Infrastructure</span><a class="self-link" href="#common-infrastructure"></a></h2> <h3 class="heading settled" data-level="3.1" id="scrolling"><span class="secno">3.1. </span><span class="content">Scrolling</span><a class="self-link" href="#scrolling"></a></h3> <p>When a user agent is to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="perform a scroll" data-noexport="" id="perform-a-scroll">perform a scroll<span class="dfn-panel" data-deco=""><b><a href="#perform-a-scroll">#perform-a-scroll</a></b><b>Referenced in:</b><span><a href="#ref-for-perform-a-scroll-1">3.1. Scrolling</a></span><span><a href="#ref-for-perform-a-scroll-2">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-perform-a-scroll-3">6.1. Element Scrolling Members</a> <a href="#ref-for-perform-a-scroll-4">(2)</a></span></span></dfn> of a <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-4">scrolling box</a> <var>box</var>, to a given position <var>position</var>, an associated element <var>element</var> and optionally a scroll behavior <var>behavior</var> (which is <code>"auto"</code> if omitted), the following steps must be run:</p> <ol> <li><a data-link-type="dfn" href="#smooth-scroll-aborted" id="ref-for-smooth-scroll-aborted-1">Abort</a> any ongoing <a data-link-type="dfn" href="#concept-smooth-scroll" id="ref-for-concept-smooth-scroll-1">smooth scroll</a> for <var>box</var>. <li> If the user agent honors the <a class="property" data-link-type="propdesc" href="#propdef-scroll-behavior" id="ref-for-propdef-scroll-behavior-1">scroll-behavior</a> property and one of the following are true: <ul> <li><var>behavior</var> is <code>"auto"</code> and <var>element</var> is not null and its computed value of the <a class="property" data-link-type="propdesc" href="#propdef-scroll-behavior" id="ref-for-propdef-scroll-behavior-2">scroll-behavior</a> property is <a class="css" data-link-type="maybe" href="#valdef-scroll-behavior-smooth" id="ref-for-valdef-scroll-behavior-smooth-1">smooth</a> <li><var>behavior</var> is <code>smooth</code> </ul> ...then perform a <a data-link-type="dfn" href="#concept-smooth-scroll" id="ref-for-concept-smooth-scroll-2">smooth scroll</a> of <var>box</var> to <var>position</var>. Otherwise, perform an <a data-link-type="dfn" href="#concept-instant-scroll" id="ref-for-concept-instant-scroll-1">instant scroll</a> of <var>box</var> to <var>position</var>. </ol> <p>When a user agent is to perform a <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="smooth scroll" data-noexport="" id="concept-smooth-scroll">smooth scroll<span class="dfn-panel" data-deco=""><b><a href="#concept-smooth-scroll">#concept-smooth-scroll</a></b><b>Referenced in:</b><span><a href="#ref-for-concept-smooth-scroll-1">3.1. Scrolling</a> <a href="#ref-for-concept-smooth-scroll-2">(2)</a> <a href="#ref-for-concept-smooth-scroll-3">(3)</a></span><span><a href="#ref-for-concept-smooth-scroll-4">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-concept-smooth-scroll-5">6.1. Element Scrolling Members</a> <a href="#ref-for-concept-smooth-scroll-6">(2)</a></span></span></dfn> of a <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-5">scrolling box</a> <var>box</var> to <var>position</var>, it must update the scroll position of <var>box</var> in a user-agent-defined fashion over a user-agent-defined amount of time. When the scroll is <dfn data-dfn-type="dfn" data-lt="smooth scroll completed" data-noexport="" id="smooth-scroll-completed">completed<a class="self-link" href="#smooth-scroll-completed"></a></dfn>, the scroll position of <var>box</var> must be <var>position</var>. The scroll can also be <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="smooth scroll aborted" data-noexport="" id="smooth-scroll-aborted">aborted<span class="dfn-panel" data-deco=""><b><a href="#smooth-scroll-aborted">#smooth-scroll-aborted</a></b><b>Referenced in:</b><span><a href="#ref-for-smooth-scroll-aborted-1">3.1. Scrolling</a></span></span></dfn>, either by an algorithm or by the user. </p> <p>When a user agent is to perform an <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="instant scroll" data-noexport="" id="concept-instant-scroll">instant scroll<span class="dfn-panel" data-deco=""><b><a href="#concept-instant-scroll">#concept-instant-scroll</a></b><b>Referenced in:</b><span><a href="#ref-for-concept-instant-scroll-1">3.1. Scrolling</a></span></span></dfn> of a <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-6">scrolling box</a> <var>box</var> to <var>position</var>, it must update the scroll position of <var>box</var> to <var>position</var>.</p> <p>To <dfn data-dfn-type="dfn" data-noexport="" id="scroll-to-the-beginning-of-the-document">scroll to the beginning of the document<a class="self-link" href="#scroll-to-the-beginning-of-the-document"></a></dfn> for a document <var>document</var>, follow these steps:</p> <ol> <li>Let <var>viewport</var> be the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-16">viewport</a> that is associated with <var>document</var>. <li>Let <var>position</var> be the the scroll position <var>viewport</var> would have by aligning the <a data-link-type="dfn" href="#beginning-edges" id="ref-for-beginning-edges-1">beginning edges</a> of the <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-3">scrolling area</a> with the <a data-link-type="dfn" href="#beginning-edges" id="ref-for-beginning-edges-2">beginning edges</a> of <var>viewport</var>. <li>If <var>position</var> is the same as <var>viewport</var>’s current scroll position, and <var>viewport</var> does not have an ongoing <a data-link-type="dfn" href="#concept-smooth-scroll" id="ref-for-concept-smooth-scroll-3">smooth scroll</a>, abort these steps. <li><a data-link-type="dfn" href="#perform-a-scroll" id="ref-for-perform-a-scroll-1">Perform a scroll</a> of <var>viewport</var> to <var>position</var>, and <var>document</var>’s root element as the associated element, if there is one, or null otherwise. </ol> <p class="note" role="note">Note: This algorithm is used when navigating to the <code>#top</code> fragment identifier, as defined in HTML. <a data-link-type="biblio" href="#biblio-html">[HTML]</a></p> <h3 class="heading settled" data-level="3.2" id="webidl-values"><span class="secno">3.2. </span><span class="content">WebIDL values</span><a class="self-link" href="#webidl-values"></a></h3> <p>When asked to <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="normalize non-finite values" data-noexport="" id="normalize-non-finite-values">normalize non-finite values<span class="dfn-panel" data-deco=""><b><a href="#normalize-non-finite-values">#normalize-non-finite-values</a></b><b>Referenced in:</b><span><a href="#ref-for-normalize-non-finite-values-1">4. Extensions to the Window Interface</a> <a href="#ref-for-normalize-non-finite-values-2">(2)</a></span><span><a href="#ref-for-normalize-non-finite-values-3">6. Extensions to the Element Interface</a> <a href="#ref-for-normalize-non-finite-values-4">(2)</a> <a href="#ref-for-normalize-non-finite-values-5">(3)</a> <a href="#ref-for-normalize-non-finite-values-6">(4)</a> <a href="#ref-for-normalize-non-finite-values-7">(5)</a> <a href="#ref-for-normalize-non-finite-values-8">(6)</a></span></span></dfn> for a value <var>x</var>, if <var>x</var> is one of the three special floating point literal values (<code>Infinity</code>, <code>-Infinity</code> or <code>NaN</code>), then <var>x</var> must be changed to the value <code>0</code>. <a data-link-type="biblio" href="#biblio-webidl">[WEBIDL]</a></p> <h2 class="heading settled" data-level="4" id="extensions-to-the-window-interface"><span class="secno">4. </span><span class="content">Extensions to the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a></code> Interface</span><a class="self-link" href="#extensions-to-the-window-interface"></a></h2> <pre class="idl def">enum <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export="" data-lt="ScrollBehavior" id="enumdef-scrollbehavior">ScrollBehavior<span class="dfn-panel" data-deco=""><b><a href="#enumdef-scrollbehavior">#enumdef-scrollbehavior</a></b><b>Referenced in:</b><span><a href="#ref-for-enumdef-scrollbehavior-1">4. Extensions to the Window Interface</a></span></span></dfn> { <dfn class="idl-code" data-dfn-for="ScrollBehavior" data-dfn-type="enum-value" data-export="" id="dom-scrollbehavior-auto">"auto"<a class="self-link" href="#dom-scrollbehavior-auto"></a></dfn>, <dfn class="idl-code" data-dfn-for="ScrollBehavior" data-dfn-type="enum-value" data-export="" id="dom-scrollbehavior-instant">"instant"<a class="self-link" href="#dom-scrollbehavior-instant"></a></dfn>, <dfn class="idl-code" data-dfn-for="ScrollBehavior" data-dfn-type="enum-value" data-export="" id="dom-scrollbehavior-smooth">"smooth"<a class="self-link" href="#dom-scrollbehavior-smooth"></a></dfn> }; dictionary <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export="" data-lt="ScrollOptions" id="dictdef-scrolloptions">ScrollOptions<span class="dfn-panel" data-deco=""><b><a href="#dictdef-scrolloptions">#dictdef-scrolloptions</a></b><b>Referenced in:</b><span><a href="#ref-for-dictdef-scrolloptions-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-dictdef-scrolloptions-2">6. Extensions to the Element Interface</a></span></span></dfn> { <a data-link-type="idl-name" href="#enumdef-scrollbehavior" id="ref-for-enumdef-scrollbehavior-1">ScrollBehavior</a> <dfn class="dfn-paneled idl-code" data-default=""auto"" data-dfn-for="ScrollOptions" data-dfn-type="dict-member" data-export="" data-lt="behavior" data-type="ScrollBehavior " id="dom-scrolloptions-behavior">behavior<span class="dfn-panel" data-deco=""><b><a href="#dom-scrolloptions-behavior">#dom-scrolloptions-behavior</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-scrolloptions-behavior-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-dom-scrolloptions-behavior-2">6. Extensions to the Element Interface</a></span><span><a href="#ref-for-dom-scrolloptions-behavior-3">6.1. Element Scrolling Members</a></span></span></dfn> = "auto"; }; dictionary <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export="" data-lt="ScrollToOptions" id="dictdef-scrolltooptions">ScrollToOptions<span class="dfn-panel" data-deco=""><b><a href="#dictdef-scrolltooptions">#dictdef-scrolltooptions</a></b><b>Referenced in:</b><span><a href="#ref-for-dictdef-scrolltooptions-1">4. Extensions to the Window Interface</a> <a href="#ref-for-dictdef-scrolltooptions-2">(2)</a> <a href="#ref-for-dictdef-scrolltooptions-3">(3)</a> <a href="#ref-for-dictdef-scrolltooptions-4">(4)</a> <a href="#ref-for-dictdef-scrolltooptions-5">(5)</a></span><span><a href="#ref-for-dictdef-scrolltooptions-6">6. Extensions to the Element Interface</a> <a href="#ref-for-dictdef-scrolltooptions-7">(2)</a> <a href="#ref-for-dictdef-scrolltooptions-8">(3)</a> <a href="#ref-for-dictdef-scrolltooptions-9">(4)</a> <a href="#ref-for-dictdef-scrolltooptions-10">(5)</a></span></span></dfn> : <a data-link-type="idl-name" href="#dictdef-scrolloptions" id="ref-for-dictdef-scrolloptions-1">ScrollOptions</a> { unrestricted double <dfn class="dfn-paneled idl-code" data-dfn-for="ScrollToOptions" data-dfn-type="dict-member" data-export="" data-lt="left" data-type="unrestricted double " id="dom-scrolltooptions-left">left<span class="dfn-panel" data-deco=""><b><a href="#dom-scrolltooptions-left">#dom-scrolltooptions-left</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-scrolltooptions-left-1">4. Extensions to the Window Interface</a> <a href="#ref-for-dom-scrolltooptions-left-2">(2)</a> <a href="#ref-for-dom-scrolltooptions-left-3">(3)</a> <a href="#ref-for-dom-scrolltooptions-left-4">(4)</a></span><span><a href="#ref-for-dom-scrolltooptions-left-5">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-scrolltooptions-left-6">(2)</a> <a href="#ref-for-dom-scrolltooptions-left-7">(3)</a> <a href="#ref-for-dom-scrolltooptions-left-8">(4)</a> <a href="#ref-for-dom-scrolltooptions-left-9">(5)</a> <a href="#ref-for-dom-scrolltooptions-left-10">(6)</a></span></span></dfn>; unrestricted double <dfn class="dfn-paneled idl-code" data-dfn-for="ScrollToOptions" data-dfn-type="dict-member" data-export="" data-lt="top" data-type="unrestricted double " id="dom-scrolltooptions-top">top<span class="dfn-panel" data-deco=""><b><a href="#dom-scrolltooptions-top">#dom-scrolltooptions-top</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-scrolltooptions-top-1">4. Extensions to the Window Interface</a> <a href="#ref-for-dom-scrolltooptions-top-2">(2)</a> <a href="#ref-for-dom-scrolltooptions-top-3">(3)</a> <a href="#ref-for-dom-scrolltooptions-top-4">(4)</a></span><span><a href="#ref-for-dom-scrolltooptions-top-5">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-scrolltooptions-top-6">(2)</a> <a href="#ref-for-dom-scrolltooptions-top-7">(3)</a> <a href="#ref-for-dom-scrolltooptions-top-8">(4)</a> <a href="#ref-for-dom-scrolltooptions-top-9">(5)</a> <a href="#ref-for-dom-scrolltooptions-top-10">(6)</a></span></span></dfn>; }; partial interface <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a> { [NewObject] <a data-link-type="idl-name" href="#mediaquerylist" id="ref-for-mediaquerylist-1">MediaQueryList</a> <a class="idl-code" data-link-type="method" href="#dom-window-matchmedia" id="ref-for-dom-window-matchmedia-2">matchMedia</a>(DOMString <dfn class="idl-code" data-dfn-for="Window/matchMedia(query)" data-dfn-type="argument" data-export="" id="dom-window-matchmedia-query-query">query<a class="self-link" href="#dom-window-matchmedia-query-query"></a></dfn>); [SameObject, Replaceable] readonly attribute <a data-link-type="idl-name" href="#screen" id="ref-for-screen-1">Screen</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Screen " href="#dom-window-screen" id="ref-for-dom-window-screen-1">screen</a>; // browsing context void <a class="idl-code" data-link-type="method" href="#dom-window-moveto" id="ref-for-dom-window-moveto-1">moveTo</a>(long <dfn class="idl-code" data-dfn-for="Window/moveTo(x, y)" data-dfn-type="argument" data-export="" id="dom-window-moveto-x-y-x">x<a class="self-link" href="#dom-window-moveto-x-y-x"></a></dfn>, long <dfn class="idl-code" data-dfn-for="Window/moveTo(x, y)" data-dfn-type="argument" data-export="" id="dom-window-moveto-x-y-y">y<a class="self-link" href="#dom-window-moveto-x-y-y"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-window-moveby" id="ref-for-dom-window-moveby-1">moveBy</a>(long <dfn class="idl-code" data-dfn-for="Window/moveBy(x, y)" data-dfn-type="argument" data-export="" id="dom-window-moveby-x-y-x">x<a class="self-link" href="#dom-window-moveby-x-y-x"></a></dfn>, long <dfn class="idl-code" data-dfn-for="Window/moveBy(x, y)" data-dfn-type="argument" data-export="" id="dom-window-moveby-x-y-y">y<a class="self-link" href="#dom-window-moveby-x-y-y"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-window-resizeto" id="ref-for-dom-window-resizeto-1">resizeTo</a>(long <dfn class="idl-code" data-dfn-for="Window/resizeTo(x, y)" data-dfn-type="argument" data-export="" id="dom-window-resizeto-x-y-x">x<a class="self-link" href="#dom-window-resizeto-x-y-x"></a></dfn>, long <dfn class="idl-code" data-dfn-for="Window/resizeTo(x, y)" data-dfn-type="argument" data-export="" id="dom-window-resizeto-x-y-y">y<a class="self-link" href="#dom-window-resizeto-x-y-y"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-window-resizeby" id="ref-for-dom-window-resizeby-1">resizeBy</a>(long <dfn class="idl-code" data-dfn-for="Window/resizeBy(x, y)" data-dfn-type="argument" data-export="" id="dom-window-resizeby-x-y-x">x<a class="self-link" href="#dom-window-resizeby-x-y-x"></a></dfn>, long <dfn class="idl-code" data-dfn-for="Window/resizeBy(x, y)" data-dfn-type="argument" data-export="" id="dom-window-resizeby-x-y-y">y<a class="self-link" href="#dom-window-resizeby-x-y-y"></a></dfn>); // viewport [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-innerwidth" id="ref-for-dom-window-innerwidth-1">innerWidth</a>; [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-innerheight" id="ref-for-dom-window-innerheight-1">innerHeight</a>; // viewport scrolling [Replaceable] readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-window-scrollx" id="ref-for-dom-window-scrollx-1">scrollX</a>; [Replaceable] readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-window-pagexoffset" id="ref-for-dom-window-pagexoffset-1">pageXOffset</a>; [Replaceable] readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-window-scrolly" id="ref-for-dom-window-scrolly-1">scrollY</a>; [Replaceable] readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-window-pageyoffset" id="ref-for-dom-window-pageyoffset-1">pageYOffset</a>; void <a class="idl-code" data-link-type="method" href="#dom-window-scroll" id="ref-for-dom-window-scroll-1">scroll</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions" id="ref-for-dictdef-scrolltooptions-1">ScrollToOptions</a> <dfn class="idl-code" data-dfn-for="Window/scroll(options), Window/scroll()" data-dfn-type="argument" data-export="" id="dom-window-scroll-options-options">options<a class="self-link" href="#dom-window-scroll-options-options"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-window-scroll" id="ref-for-dom-window-scroll-2">scroll</a>(unrestricted double <dfn class="idl-code" data-dfn-for="Window/scroll(x, y)" data-dfn-type="argument" data-export="" id="dom-window-scroll-x-y-x">x<a class="self-link" href="#dom-window-scroll-x-y-x"></a></dfn>, unrestricted double <dfn class="idl-code" data-dfn-for="Window/scroll(x, y)" data-dfn-type="argument" data-export="" id="dom-window-scroll-x-y-y">y<a class="self-link" href="#dom-window-scroll-x-y-y"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-window-scrollto" id="ref-for-dom-window-scrollto-1">scrollTo</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions" id="ref-for-dictdef-scrolltooptions-2">ScrollToOptions</a> <dfn class="idl-code" data-dfn-for="Window/scrollTo(options), Window/scrollTo()" data-dfn-type="argument" data-export="" id="dom-window-scrollto-options-options">options<a class="self-link" href="#dom-window-scrollto-options-options"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-window-scrollto" id="ref-for-dom-window-scrollto-2">scrollTo</a>(unrestricted double <dfn class="idl-code" data-dfn-for="Window/scrollTo(x, y)" data-dfn-type="argument" data-export="" id="dom-window-scrollto-x-y-x">x<a class="self-link" href="#dom-window-scrollto-x-y-x"></a></dfn>, unrestricted double <dfn class="idl-code" data-dfn-for="Window/scrollTo(x, y)" data-dfn-type="argument" data-export="" id="dom-window-scrollto-x-y-y">y<a class="self-link" href="#dom-window-scrollto-x-y-y"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-window-scrollby" id="ref-for-dom-window-scrollby-1">scrollBy</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions" id="ref-for-dictdef-scrolltooptions-3">ScrollToOptions</a> <dfn class="idl-code" data-dfn-for="Window/scrollBy(options), Window/scrollBy()" data-dfn-type="argument" data-export="" id="dom-window-scrollby-options-options">options<a class="self-link" href="#dom-window-scrollby-options-options"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-window-scrollby" id="ref-for-dom-window-scrollby-2">scrollBy</a>(unrestricted double <dfn class="idl-code" data-dfn-for="Window/scrollBy(x, y)" data-dfn-type="argument" data-export="" id="dom-window-scrollby-x-y-x">x<a class="self-link" href="#dom-window-scrollby-x-y-x"></a></dfn>, unrestricted double <dfn class="idl-code" data-dfn-for="Window/scrollBy(x, y)" data-dfn-type="argument" data-export="" id="dom-window-scrollby-x-y-y">y<a class="self-link" href="#dom-window-scrollby-x-y-y"></a></dfn>); // client [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-screenx" id="ref-for-dom-window-screenx-1">screenX</a>; [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-screeny" id="ref-for-dom-window-screeny-1">screenY</a>; [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-outerwidth" id="ref-for-dom-window-outerwidth-1">outerWidth</a>; [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-outerheight" id="ref-for-dom-window-outerheight-1">outerHeight</a>; [Replaceable] readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-window-devicepixelratio" id="ref-for-dom-window-devicepixelratio-1">devicePixelRatio</a>; }; </pre> <p>When the <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="method" data-export="" data-lt="matchMedia(query)" id="dom-window-matchmedia">matchMedia(<var>query</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-window-matchmedia">#dom-window-matchmedia</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-matchmedia-1">2.1. CSS pixels</a></span><span><a href="#ref-for-dom-window-matchmedia-2">4. Extensions to the Window Interface</a></span></span></dfn> method is invoked these steps must be run:</p> <ol> <li>Let <var>parsed media query list</var> be the result of <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#parse-a-media-query-list">parsing</a> <var>query</var>. <li>Return a new <code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-2">MediaQueryList</a></code> object, with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object’s</a> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-document-window">associated <code>Document</code></a> as the <a data-link-type="dfn" href="#mediaquerylist-document" id="ref-for-mediaquerylist-document-1">document</a>, with <var>parsed media query list</var> as its associated <a data-link-type="dfn" href="#media-query-list" id="ref-for-media-query-list-1">media query list</a>. </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="screen" id="dom-window-screen">screen<span class="dfn-panel" data-deco=""><b><a href="#dom-window-screen">#dom-window-screen</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-screen-1">4. Extensions to the Window Interface</a> <a href="#ref-for-dom-window-screen-2">(2)</a></span></span></dfn> attribute must return the <code class="idl"><a data-link-type="idl" href="#screen" id="ref-for-screen-2">Screen</a></code> object associated with the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a></code> object.</p> <p class="note" role="note">Note: Accessing <code class="idl"><a data-link-type="idl" href="#dom-window-screen" id="ref-for-dom-window-screen-2">screen</a></code> through a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#windowproxy">WindowProxy</a></code> object might yield different results when the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> is navigated.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="method" data-export="" data-lt="moveTo(x, y)" id="dom-window-moveto">moveTo(<var>x</var>, <var>y</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-window-moveto">#dom-window-moveto</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-moveto-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-dom-window-moveto-2">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> method must follow these steps:</p> <ol> <li data-md=""> <p>Optionally, terminate these steps.</p> <li data-md=""> <p>Let <var>target</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context">browsing context</a> of the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>.</p> <li data-md=""> <p>Let <var>source</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context">responsible browsing context</a> of the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object">incumbent settings object</a>.</p> <li data-md=""> <p>If <var>source</var> is not <a data-link-type="dfn" href="#allowed-to-resize-and-move" id="ref-for-allowed-to-resize-and-move-1">allowed to resize and move</a> <var>target</var>, terminate these steps.</p> <li data-md=""> <p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not move outside the available space.</p> <li data-md=""> <p>Move <var>target</var>’s window such that the window’s top left corner is at coordinates (<var>x</var>, <var>y</var>) relative to the top left corner of the output device, measured in CSS pixels of <var>target</var>. The positive axes are rightward and downward.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="method" data-export="" data-lt="moveBy(x, y)" id="dom-window-moveby">moveBy(<var>x</var>, <var>y</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-window-moveby">#dom-window-moveby</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-moveby-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-dom-window-moveby-2">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> method must follow these steps:</p> <ol> <li data-md=""> <p>Optionally, terminate these steps.</p> <li data-md=""> <p>Let <var>target</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context">browsing context</a> of the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>.</p> <li data-md=""> <p>Let <var>source</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context">responsible browsing context</a> of the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object">incumbent settings object</a>.</p> <li data-md=""> <p>If <var>source</var> is not <a data-link-type="dfn" href="#allowed-to-resize-and-move" id="ref-for-allowed-to-resize-and-move-2">allowed to resize and move</a> <var>target</var>, terminate these steps.</p> <li data-md=""> <p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not move outside the available space.</p> <li data-md=""> <p>Move <var>target</var>’s window <var>x</var> CSS pixels of <var>target</var> rightward and <var>y</var> CSS pixels of <var>target</var> downward.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="method" data-export="" data-lt="resizeTo(x, y)" id="dom-window-resizeto">resizeTo(<var>x</var>, <var>y</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-window-resizeto">#dom-window-resizeto</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-resizeto-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-dom-window-resizeto-2">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> method must follow these steps:</p> <ol> <li data-md=""> <p>Optionally, terminate these steps.</p> <li data-md=""> <p>Let <var>target</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context">browsing context</a> of the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>.</p> <li data-md=""> <p>Let <var>source</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context">responsible browsing context</a> of the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object">incumbent settings object</a>.</p> <li data-md=""> <p>If <var>source</var> is not <a data-link-type="dfn" href="#allowed-to-resize-and-move" id="ref-for-allowed-to-resize-and-move-3">allowed to resize and move</a> <var>target</var>, terminate these steps.</p> <li data-md=""> <p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available space.</p> <li data-md=""> <p>Resize <var>target</var>’s window by moving its right and bottom edges such that the distance between the left and right edges of the viewport are <var>x</var> CSS pixels of <var>target</var> and the distance between the top and bottom edges of the viewport are <var>y</var> CSS pixels of <var>target</var>.</p> <li data-md=""> <p>Optionally, move <var>target</var>’s window in a user-agent-defined manner so that it does not grow outside the available space.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="method" data-export="" data-lt="resizeBy(x, y)" id="dom-window-resizeby">resizeBy(<var>x</var>, <var>y</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-window-resizeby">#dom-window-resizeby</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-resizeby-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-dom-window-resizeby-2">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> method must follow these steps:</p> <ol> <li data-md=""> <p>Optionally, terminate these steps.</p> <li data-md=""> <p>Let <var>target</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context">browsing context</a> of the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object">context object</a>.</p> <li data-md=""> <p>Let <var>source</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context">responsible browsing context</a> of the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object">incumbent settings object</a>.</p> <li data-md=""> <p>If <var>source</var> is not <a data-link-type="dfn" href="#allowed-to-resize-and-move" id="ref-for-allowed-to-resize-and-move-4">allowed to resize and move</a> <var>target</var>, terminate these steps.</p> <li data-md=""> <p>Optionally, clamp <var>x</var> and <var>y</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available space.</p> <li data-md=""> <p>Resize <var>target</var>’s window by moving its right edge <var>x</var> CSS pixels of <var>target</var> rightward and its bottom edge <var>y</var> CSS pixels of <var>target</var> downward.</p> <li data-md=""> <p>Optionally, move <var>target</var>’s window in a user-agent-defined manner so that it does not grow outside the available space.</p> </ol> <p>A <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context">browsing context</a> <var>A</var> is <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="allowed to resize and move" data-noexport="" id="allowed-to-resize-and-move">allowed to resize and move<span class="dfn-panel" data-deco=""><b><a href="#allowed-to-resize-and-move">#allowed-to-resize-and-move</a></b><b>Referenced in:</b><span><a href="#ref-for-allowed-to-resize-and-move-1">4. Extensions to the Window Interface</a> <a href="#ref-for-allowed-to-resize-and-move-2">(2)</a> <a href="#ref-for-allowed-to-resize-and-move-3">(3)</a> <a href="#ref-for-allowed-to-resize-and-move-4">(4)</a></span></span></dfn> a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context">browsing context</a> <var>B</var> if all the following conditions are met:</p> <ul> <li data-md=""> <p><var>B</var> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#auxiliary-browsing-context">auxiliary browsing context</a> that was created by a script (as opposed to by an action of the user).</p> <li data-md=""> <p><var>A</var> is <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#familiar-with">familiar with</a> <var>B</var>.</p> </ul> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="innerWidth" id="dom-window-innerwidth">innerWidth<span class="dfn-panel" data-deco=""><b><a href="#dom-window-innerwidth">#dom-window-innerwidth</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-innerwidth-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-dom-window-innerwidth-2">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> attribute must return the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-17">viewport</a> width including the size of a rendered scroll bar (if any), or zero if there is no <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-18">viewport</a>. </p> <div class="example" id="example-28baa0e2"> <a class="self-link" href="#example-28baa0e2"></a> The following snippet shows how to obtain the width of the viewport: <pre>var viewportWidth = innerWidth</pre> </div> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="innerHeight" id="dom-window-innerheight">innerHeight<span class="dfn-panel" data-deco=""><b><a href="#dom-window-innerheight">#dom-window-innerheight</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-innerheight-1">4. Extensions to the Window Interface</a></span></span></dfn> attribute must return the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-19">viewport</a> height including the size of a rendered scroll bar (if any), or zero if there is no <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-20">viewport</a>. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="scrollX" id="dom-window-scrollx">scrollX<span class="dfn-panel" data-deco=""><b><a href="#dom-window-scrollx">#dom-window-scrollx</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-scrollx-1">4. Extensions to the Window Interface</a> <a href="#ref-for-dom-window-scrollx-2">(2)</a> <a href="#ref-for-dom-window-scrollx-3">(3)</a></span><span><a href="#ref-for-dom-window-scrollx-4">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-window-scrollx-5">(2)</a> <a href="#ref-for-dom-window-scrollx-6">(3)</a> <a href="#ref-for-dom-window-scrollx-7">(4)</a> <a href="#ref-for-dom-window-scrollx-8">(5)</a></span><span><a href="#ref-for-dom-window-scrollx-9">10. Extensions to the MouseEvent Interface</a></span></span></dfn> attribute attribute must return the x-coordinate, relative to the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> origin, of the left of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-21">viewport</a>, or zero if there is no <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-22">viewport</a>. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="pageXOffset" id="dom-window-pagexoffset">pageXOffset<span class="dfn-panel" data-deco=""><b><a href="#dom-window-pagexoffset">#dom-window-pagexoffset</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-pagexoffset-1">4. Extensions to the Window Interface</a></span></span></dfn> attribute must return the value returned by the <code class="idl"><a data-link-type="idl" href="#dom-window-scrollx" id="ref-for-dom-window-scrollx-2">scrollX</a></code> attribute.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="scrollY" id="dom-window-scrolly">scrollY<span class="dfn-panel" data-deco=""><b><a href="#dom-window-scrolly">#dom-window-scrolly</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-scrolly-1">4. Extensions to the Window Interface</a> <a href="#ref-for-dom-window-scrolly-2">(2)</a> <a href="#ref-for-dom-window-scrolly-3">(3)</a></span><span><a href="#ref-for-dom-window-scrolly-4">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-window-scrolly-5">(2)</a> <a href="#ref-for-dom-window-scrolly-6">(3)</a> <a href="#ref-for-dom-window-scrolly-7">(4)</a></span><span><a href="#ref-for-dom-window-scrolly-8">10. Extensions to the MouseEvent Interface</a></span></span></dfn> attribute attribute must return the y-coordinate, relative to the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> origin, of the top of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-23">viewport</a>, or zero if there is no <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-24">viewport</a>. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="pageYOffset" id="dom-window-pageyoffset">pageYOffset<span class="dfn-panel" data-deco=""><b><a href="#dom-window-pageyoffset">#dom-window-pageyoffset</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-pageyoffset-1">4. Extensions to the Window Interface</a></span></span></dfn> attribute must return the value returned by the <code class="idl"><a data-link-type="idl" href="#dom-window-scrolly" id="ref-for-dom-window-scrolly-2">scrollY</a></code> attribute.</p> <p>When the <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="method" data-export="" data-lt="scroll(options)|scroll(x, y)" id="dom-window-scroll">scroll()<span class="dfn-panel" data-deco=""><b><a href="#dom-window-scroll">#dom-window-scroll</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-scroll-1">4. Extensions to the Window Interface</a> <a href="#ref-for-dom-window-scroll-2">(2)</a> <a href="#ref-for-dom-window-scroll-3">(3)</a> <a href="#ref-for-dom-window-scroll-4">(4)</a></span><span><a href="#ref-for-dom-window-scroll-5">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-window-scroll-6">(2)</a> <a href="#ref-for-dom-window-scroll-7">(3)</a> <a href="#ref-for-dom-window-scroll-8">(4)</a> <a href="#ref-for-dom-window-scroll-9">(5)</a> <a href="#ref-for-dom-window-scroll-10">(6)</a></span><span><a href="#ref-for-dom-window-scroll-11">Changes From 17 December 2013</a></span></span></dfn> method is invoked these steps must be run:</p> <ol> <li data-md=""> <p>If invoked with one argument, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>options</var> be the argument.</p> <li data-md=""> <p>Let <var>x</var> be the value of the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-left" id="ref-for-dom-scrolltooptions-left-1">left</a></code> dictionary member of <var>options</var>, if present, or the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-25">viewport’s</a> current scroll position on the x axis otherwise.</p> <li data-md=""> <p>Let <var>y</var> be the value of the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-top" id="ref-for-dom-scrolltooptions-top-1">top</a></code> dictionary member of <var>options</var>, if present, or the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-26">viewport’s</a> current scroll position on the y axis otherwise.</p> </ol> <li data-md=""> <p>If invoked with two arguments, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>options</var> be null <a data-link-type="dfn" href="http://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value">converted</a> to a <code class="idl"><a data-link-type="idl" href="#dictdef-scrolltooptions" id="ref-for-dictdef-scrolltooptions-4">ScrollToOptions</a></code> dictionary. <a data-link-type="biblio" href="#biblio-webidl">[WEBIDL]</a></p> <li data-md=""> <p>Let <var>x</var> and <var>y</var> be the arguments, respectively.</p> </ol> <li data-md=""> <p><a data-link-type="dfn" href="#normalize-non-finite-values" id="ref-for-normalize-non-finite-values-1">Normalize non-finite values</a> for <var>x</var> and <var>y</var>.</p> <li data-md=""> <p>If there is no <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-27">viewport</a>, abort these steps.</p> <li data-md=""> <p>Let <var>viewport width</var> be the width of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-28">viewport</a> excluding the width of the scroll bar, if any.</p> <li data-md=""> <p>Let <var>viewport height</var> be the height of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-29">viewport</a> excluding the height of the scroll bar, if any.</p> <li data-md=""> <dl class="switch"> <dt>If the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-30">viewport</a> has rightward <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-11">overflow direction</a> <dd>Let <var>x</var> be max(0, min(<var>x</var>, <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-31">viewport</a> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-4">scrolling area</a> width - <var>viewport width</var>)). <dt>If the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-32">viewport</a> has leftward <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-12">overflow direction</a> <dd>Let <var>x</var> be min(0, max(<var>x</var>, <var>viewport width</var> - <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-33">viewport</a> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-5">scrolling area</a> width)). </dl> <li data-md=""> <dl class="switch"> <dt>If the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-34">viewport</a> has downward <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-13">overflow direction</a> <dd>Let <var>y</var> be max(0, min(<var>y</var>, <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-35">viewport</a> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-6">scrolling area</a> height - <var>viewport height</var>)). <dt>If the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-36">viewport</a> has upward <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-14">overflow direction</a> <dd>Let <var>y</var> be min(0, max(<var>y</var>, <var>viewport height</var> - <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-37">viewport</a> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-7">scrolling area</a> height)). </dl> <li data-md=""> <p>Let <var>position</var> be the scroll position the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-38">viewport</a> would have by aligning the x-coordinate <var>x</var> of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-39">viewport</a> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-8">scrolling area</a> with the left of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-40">viewport</a> and aligning the y-coordinate <var>y</var> of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-41">viewport</a> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-9">scrolling area</a> with the top of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-42">viewport</a>.</p> <li data-md=""> <p>If <var>position</var> is the same as the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-43">viewport’s</a> current scroll position, and the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-44">viewport</a> does not have an ongoing <a data-link-type="dfn" href="#concept-smooth-scroll" id="ref-for-concept-smooth-scroll-4">smooth scroll</a>, abort these steps.</p> <li data-md=""> <p>Let <var>document</var> be the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-45">viewport’s</a> associated <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code>.</p> <li data-md=""> <p><a data-link-type="dfn" href="#perform-a-scroll" id="ref-for-perform-a-scroll-2">Perform a scroll</a> of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-46">viewport</a> to <var>position</var>, <var>document</var>’s root element as the associated element, if there is one, or null otherwise, and the scroll behavior being the value of the <code class="idl"><a data-link-type="idl" href="#dom-scrolloptions-behavior" id="ref-for-dom-scrolloptions-behavior-1">behavior</a></code> dictionary member of <var>options</var>.</p> </ol> <p>When the <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="method" data-export="" data-lt="scrollTo(options)|scrollTo(x, y)" id="dom-window-scrollto">scrollTo()<span class="dfn-panel" data-deco=""><b><a href="#dom-window-scrollto">#dom-window-scrollto</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-scrollto-1">4. Extensions to the Window Interface</a> <a href="#ref-for-dom-window-scrollto-2">(2)</a></span><span><a href="#ref-for-dom-window-scrollto-3">Changes From 17 December 2013</a></span></span></dfn> method is invoked, the user agent must act as if the <code class="idl"><a data-link-type="idl" href="#dom-window-scroll" id="ref-for-dom-window-scroll-3">scroll()</a></code> method was invoked with the same arguments.</p> <p>When the <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="method" data-export="" data-lt="scrollBy(options)|scrollBy(x, y)" id="dom-window-scrollby">scrollBy()<span class="dfn-panel" data-deco=""><b><a href="#dom-window-scrollby">#dom-window-scrollby</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-scrollby-1">4. Extensions to the Window Interface</a> <a href="#ref-for-dom-window-scrollby-2">(2)</a></span><span><a href="#ref-for-dom-window-scrollby-3">Changes From 17 December 2013</a></span></span></dfn> method is invoked, the user agent must run these steps:</p> <ol> <li data-md=""> <p>If invoked with two arguments, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>options</var> be null <a data-link-type="dfn" href="http://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value">converted</a> to a <code class="idl"><a data-link-type="idl" href="#dictdef-scrolltooptions" id="ref-for-dictdef-scrolltooptions-5">ScrollToOptions</a></code> dictionary. <a data-link-type="biblio" href="#biblio-webidl">[WEBIDL]</a></p> <li data-md=""> <p>Let <var>x</var> and <var>y</var> be the arguments, respectively.</p> <li data-md=""> <p>Let the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-left" id="ref-for-dom-scrolltooptions-left-2">left</a></code> dictionary member of <var>options</var> have the value <var>x</var>.</p> <li data-md=""> <p>Let the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-top" id="ref-for-dom-scrolltooptions-top-2">top</a></code> dictionary member of <var>options</var> have the value <var>y</var>.</p> </ol> <li data-md=""> <p><a data-link-type="dfn" href="#normalize-non-finite-values" id="ref-for-normalize-non-finite-values-2">Normalize non-finite values</a> for the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-left" id="ref-for-dom-scrolltooptions-left-3">left</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-top" id="ref-for-dom-scrolltooptions-top-3">top</a></code> dictionary members of <var>options</var>.</p> <li data-md=""> <p>Add the value of <code class="idl"><a data-link-type="idl" href="#dom-window-scrollx" id="ref-for-dom-window-scrollx-3">scrollX</a></code> to the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-left" id="ref-for-dom-scrolltooptions-left-4">left</a></code> dictionary member.</p> <li data-md=""> <p>Add the value of <code class="idl"><a data-link-type="idl" href="#dom-window-scrolly" id="ref-for-dom-window-scrolly-3">scrollY</a></code> to the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-top" id="ref-for-dom-scrolltooptions-top-4">top</a></code> dictionary member.</p> <li data-md=""> <p>Act as if the <code class="idl"><a data-link-type="idl" href="#dom-window-scroll" id="ref-for-dom-window-scroll-4">scroll()</a></code> method was invoked with <var>options</var> as the only argument.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="screenX" id="dom-window-screenx">screenX<span class="dfn-panel" data-deco=""><b><a href="#dom-window-screenx">#dom-window-screenx</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-screenx-1">4. Extensions to the Window Interface</a></span></span></dfn> attribute must return the x-coordinate, relative to the origin of the screen of the output device, of the left of the client window as number of pixels, or zero if there is no such thing. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="screenY" id="dom-window-screeny">screenY<span class="dfn-panel" data-deco=""><b><a href="#dom-window-screeny">#dom-window-screeny</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-screeny-1">4. Extensions to the Window Interface</a></span></span></dfn> attribute must return the y-coordinate, relative to the origin of the screen of the output device, of the top of the client window as number of pixels, or zero if there is no such thing. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="outerWidth" id="dom-window-outerwidth">outerWidth<span class="dfn-panel" data-deco=""><b><a href="#dom-window-outerwidth">#dom-window-outerwidth</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-outerwidth-1">4. Extensions to the Window Interface</a></span></span></dfn> attribute must return the width of the client window. If there is no client window this attribute must return zero. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="outerHeight" id="dom-window-outerheight">outerHeight<span class="dfn-panel" data-deco=""><b><a href="#dom-window-outerheight">#dom-window-outerheight</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-outerheight-1">4. Extensions to the Window Interface</a></span></span></dfn> attribute must return the height of the client window. If there is no client window this attribute must return zero. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="attribute" data-export="" data-lt="devicePixelRatio" id="dom-window-devicepixelratio">devicePixelRatio<span class="dfn-panel" data-deco=""><b><a href="#dom-window-devicepixelratio">#dom-window-devicepixelratio</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-window-devicepixelratio-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-dom-window-devicepixelratio-2">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> attribute must return the result of the following algorithm:</p> <ol> <li data-md=""> <p>If there is no output device, return 1 and abort these steps.</p> <li data-md=""> <p>Let <var>CSS pixel size</var> be the size of a CSS pixel at the current <a data-link-type="dfn" href="#page-zoom" id="ref-for-page-zoom-1">page zoom</a> scale factor and at a <a data-link-type="dfn" href="#pinch-zoom" id="ref-for-pinch-zoom-1">pinch zoom</a> scale factor of 1.0.</p> <li data-md=""> <p>Let <var>device pixel size</var> be the vertical size of a device pixel of the output device.</p> <li data-md=""> <p>Return the result of dividing <var>CSS pixel size</var> by <var>device pixel size</var>.</p> </ol> <h3 class="heading settled" data-level="4.1" id="the-features-argument-to-the-open()-method"><span class="secno">4.1. </span><span class="content">The <var>features</var> argument to the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#dom-open">open()</a></code> method</span><a class="self-link" href="#the-features-argument-to-the-open%28%29-method"></a></h3> <p>HTML defines the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#dom-open">open()</a></code> method but has no defined effect for the third argument, <var>features</var>. <a data-link-type="biblio" href="#biblio-html">[HTML]</a></p> <p>This specification defines the effect of the <var>features</var> argument for user agents that do not opt to ignore it, as follows:</p> <ol> <li data-md=""> <p>If the method does not result in a new <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#auxiliary-browsing-context">auxiliary browsing context</a> being created, terminate these steps.</p> <li data-md=""> <p>Let <var>target</var> be the new <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#auxiliary-browsing-context">auxiliary browsing context</a>.</p> <li data-md=""> <p>Let <var>tokens</var> be the result of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#split-a-string-on-commas">splitting <var>features</var> on commas</a>.</p> <li data-md=""> <p>Let <var>parsed features</var> be a new empty dictionary.</p> <li data-md=""> <p><i>Token loop</i>: For each token <var>token</var> in <var>tokens</var>, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>input</var> be <var>token</var>.</p> <li data-md=""> <p>Let <var>position</var> point at the first character of <var>input</var>.</p> <li data-md=""> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#skip-whitespace">Skip whitespace</a>.</p> <li data-md=""> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#collect-a-sequence-of-characters">Collect a sequence of characters</a> that are not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#space-character">space characters</a> nor "<code>=</code>" (U+003D). Let <var>name</var> be the collected characters, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</p> <li data-md=""> <p>If <var>name</var> is in <var>parsed features</var> or if <var>name</var> is not a <a data-link-type="dfn" href="#supported-open-feature-name" id="ref-for-supported-open-feature-name-1">supported <code>open()</code> feature name</a>, continue <i>token loop</i>.</p> <li data-md=""> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#skip-whitespace">Skip whitespace</a>.</p> <li data-md=""> <p>If the character at <var>position</var> is not "<code>=</code>" (U+003D), continue <i>token loop</i>.</p> <li data-md=""> <p>Advance <var>position</var> by one.</p> <li data-md=""> <p>If <var>position</var> is past the end of <var>input</var>, continue <i>token loop</i>.</p> <li data-md=""> <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#collect-a-sequence-of-characters">Collect a sequence of characters</a> that are any characters. Let <var>raw value</var> be the collected characters.</p> <li data-md=""> <p>Let <var>value</var> be the result of invoking the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-integers">rules for parsing integers</a> on <var>raw value</var>.</p> <li data-md=""> <p>If <var>value</var> is an error, continue <i>token loop</i>.</p> <li data-md=""> <p>Set <var>name</var> in <var>parsed features</var> to <var>value</var>.</p> </ol> <li data-md=""> <p>If <a data-link-type="dfn" href="#supported-open-feature-name-left" id="ref-for-supported-open-feature-name-left-1">left</a> is present in <var>parsed features</var>, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>x</var> be the value of <a data-link-type="dfn" href="#supported-open-feature-name-left" id="ref-for-supported-open-feature-name-left-2">left</a>.</p> <li data-md=""> <p>Optionally, clamp <var>x</var> in a user-agent-defined manner so that the window does not move outside the available space.</p> <li data-md=""> <p>Optionally, move <var>target</var>’s window such that the window’s left edge is at the horizontal coordinate <var>x</var> relative to the left edge of the output device, measured in CSS pixels of <var>target</var>. The positive axis is rightward.</p> </ol> <li data-md=""> <p>If <a data-link-type="dfn" href="#supported-open-feature-name-top" id="ref-for-supported-open-feature-name-top-1">top</a> is present in <var>parsed features</var>, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>y</var> be the value of <a data-link-type="dfn" href="#supported-open-feature-name-top" id="ref-for-supported-open-feature-name-top-2">top</a>.</p> <li data-md=""> <p>Optionally, clamp <var>y</var> in a user-agent-defined manner so that the window does not move outside the available space.</p> <li data-md=""> <p>Optionally, move <var>target</var>’s window such that the window’s top edge is at the vertical coordinate <var>y</var> relative to the top edge of the output device, measured in CSS pixels of <var>target</var>. The positive axis is downward.</p> </ol> <li data-md=""> <p>If <a data-link-type="dfn" href="#supported-open-feature-name-width" id="ref-for-supported-open-feature-name-width-1">width</a> is present in <var>parsed features</var>, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>x</var> be the value of <a data-link-type="dfn" href="#supported-open-feature-name-width" id="ref-for-supported-open-feature-name-width-2">width</a>.</p> <li data-md=""> <p>Optionally, clamp <var>x</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available space.</p> <li data-md=""> <p>Optionally, size <var>target</var>’s window by moving its right edge such that the distance between the left and right edges of the viewport are <var>x</var> CSS pixels of <var>target</var>.</p> <li data-md=""> <p>Optionally, move <var>target</var>’s window in a user-agent-defined manner so that it does not grow outside the available space.</p> </ol> <li data-md=""> <p>If <a data-link-type="dfn" href="#supported-open-feature-name-height" id="ref-for-supported-open-feature-name-height-1">height</a> is present in <var>parsed features</var>, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>y</var> be the value of <a data-link-type="dfn" href="#supported-open-feature-name-height" id="ref-for-supported-open-feature-name-height-2">height</a>.</p> <li data-md=""> <p>Optionally, clamp <var>y</var> in a user-agent-defined manner so that the window does not get too small or bigger than the available space.</p> <li data-md=""> <p>Optionally, size <var>target</var>’s window by moving its bottom edge such that the distance between the top and bottom edges of the viewport are <var>y</var> CSS pixels of <var>target</var>.</p> <li data-md=""> <p>Optionally, move <var>target</var>’s window in a user-agent-defined manner so that it does not grow outside the available space.</p> </ol> </ol> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export="" data-lt="supported open() feature name" id="supported-open-feature-name">supported <code>open()</code> feature name<span class="dfn-panel" data-deco=""><b><a href="#supported-open-feature-name">#supported-open-feature-name</a></b><b>Referenced in:</b><span><a href="#ref-for-supported-open-feature-name-1">4.1. The features argument to the open() method</a></span></span></dfn> is one of the following:</p> <dl> <dt><dfn class="dfn-paneled" data-dfn-for="supported open() feature name" data-dfn-type="dfn" data-export="" data-lt="width" id="supported-open-feature-name-width">width<span class="dfn-panel" data-deco=""><b><a href="#supported-open-feature-name-width">#supported-open-feature-name-width</a></b><b>Referenced in:</b><span><a href="#ref-for-supported-open-feature-name-width-1">4.1. The features argument to the open() method</a> <a href="#ref-for-supported-open-feature-name-width-2">(2)</a></span></span></dfn> <dd>The width of the viewport. <dt><dfn class="dfn-paneled" data-dfn-for="supported open() feature name" data-dfn-type="dfn" data-export="" data-lt="height" id="supported-open-feature-name-height">height<span class="dfn-panel" data-deco=""><b><a href="#supported-open-feature-name-height">#supported-open-feature-name-height</a></b><b>Referenced in:</b><span><a href="#ref-for-supported-open-feature-name-height-1">4.1. The features argument to the open() method</a> <a href="#ref-for-supported-open-feature-name-height-2">(2)</a></span></span></dfn> <dd>The height of the viewport. <dt><dfn class="dfn-paneled" data-dfn-for="supported open() feature name" data-dfn-type="dfn" data-export="" data-lt="left" id="supported-open-feature-name-left">left<span class="dfn-panel" data-deco=""><b><a href="#supported-open-feature-name-left">#supported-open-feature-name-left</a></b><b>Referenced in:</b><span><a href="#ref-for-supported-open-feature-name-left-1">4.1. The features argument to the open() method</a> <a href="#ref-for-supported-open-feature-name-left-2">(2)</a></span></span></dfn> <dd>The left position of the window. <dt><dfn class="dfn-paneled" data-dfn-for="supported open() feature name" data-dfn-type="dfn" data-export="" data-lt="top" id="supported-open-feature-name-top">top<span class="dfn-panel" data-deco=""><b><a href="#supported-open-feature-name-top">#supported-open-feature-name-top</a></b><b>Referenced in:</b><span><a href="#ref-for-supported-open-feature-name-top-1">4.1. The features argument to the open() method</a> <a href="#ref-for-supported-open-feature-name-top-2">(2)</a></span></span></dfn> <dd>The top position of the window. </dl> <h3 class="heading settled" data-level="4.2" id="the-mediaquerylist-interface"><span class="secno">4.2. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-3">MediaQueryList</a></code> Interface</span><a class="self-link" href="#the-mediaquerylist-interface"></a></h3> <p>This section integrates with the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop">event loop</a> defined in HTML. <a data-link-type="biblio" href="#biblio-html">[HTML]</a></p> <p>A <code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-4">MediaQueryList</a></code> object has an associated <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="media query list" data-noexport="" id="media-query-list">media query list<span class="dfn-panel" data-deco=""><b><a href="#media-query-list">#media-query-list</a></b><b>Referenced in:</b><span><a href="#ref-for-media-query-list-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-media-query-list-2">4.2. The MediaQueryList Interface</a> <a href="#ref-for-media-query-list-3">(2)</a></span></span></dfn> and an associated <dfn class="dfn-paneled" data-dfn-for="MediaQueryList" data-dfn-type="dfn" data-lt="document" data-noexport="" id="mediaquerylist-document">document<span class="dfn-panel" data-deco=""><b><a href="#mediaquerylist-document">#mediaquerylist-document</a></b><b>Referenced in:</b><span><a href="#ref-for-mediaquerylist-document-1">4. Extensions to the Window Interface</a></span><span><a href="#ref-for-mediaquerylist-document-2">4.2. The MediaQueryList Interface</a> <a href="#ref-for-mediaquerylist-document-3">(2)</a></span></span></dfn> set on creation.</p> <p>A <code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-5">MediaQueryList</a></code> object has an associated <dfn class="dfn-paneled" data-dfn-for="MediaQueryList" data-dfn-type="dfn" data-lt="media" data-noexport="" id="mediaquerylist-media">media<span class="dfn-panel" data-deco=""><b><a href="#mediaquerylist-media">#mediaquerylist-media</a></b><b>Referenced in:</b><span><a href="#ref-for-mediaquerylist-media-1">4.2. The MediaQueryList Interface</a> <a href="#ref-for-mediaquerylist-media-2">(2)</a></span></span></dfn> which is the <a data-link-type="dfn" href="https://drafts.csswg.org/cssom/#serialize-a-media-query-list">serialized</a> form of the associated <a data-link-type="dfn" href="#media-query-list" id="ref-for-media-query-list-2">media query list</a>.</p> <p>A <code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-6">MediaQueryList</a></code> object has an associated <dfn class="dfn-paneled" data-dfn-for="MediaQueryList" data-dfn-type="dfn" data-lt="matches state" data-noexport="" id="mediaquerylist-matches-state">matches state<span class="dfn-panel" data-deco=""><b><a href="#mediaquerylist-matches-state">#mediaquerylist-matches-state</a></b><b>Referenced in:</b><span><a href="#ref-for-mediaquerylist-matches-state-1">4.2. The MediaQueryList Interface</a> <a href="#ref-for-mediaquerylist-matches-state-2">(2)</a> <a href="#ref-for-mediaquerylist-matches-state-3">(3)</a></span><span><a href="#ref-for-mediaquerylist-matches-state-4">4.2.1. Event summary</a></span></span></dfn> which is true if the associated <a data-link-type="dfn" href="#media-query-list" id="ref-for-media-query-list-3">media query list</a> matches the state of the <a data-link-type="dfn" href="#mediaquerylist-document" id="ref-for-mediaquerylist-document-2">document</a>, and false otherwise.</p> <p>When asked to <dfn data-dfn-type="dfn" data-noexport="" id="evaluate-media-queries-and-report-changes">evaluate media queries and report changes<a class="self-link" href="#evaluate-media-queries-and-report-changes"></a></dfn> for a <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> <var>doc</var>, run these steps:</p> <ol> <li> <p>For each <code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-7">MediaQueryList</a></code> object <var>target</var> that has <var>doc</var> as its <a data-link-type="dfn" href="#mediaquerylist-document" id="ref-for-mediaquerylist-document-3">document</a>, in the order they were created, oldest first, run these substeps:</p> <ol> <li>If <var>target</var>’s <a data-link-type="dfn" href="#mediaquerylist-matches-state" id="ref-for-mediaquerylist-matches-state-1">matches state</a> has changed since the last time these steps were run, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch">dispatch</a> a new <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event">event</a> to <var>target</var> using the <code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-8">MediaQueryList</a></code> interface, with its <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-event-type">type</a></code> attribute initialized to <a class="idl-code" data-link-type="event" href="#eventdef-mediaquerylist-change" id="ref-for-eventdef-mediaquerylist-change-1">change</a>, its <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-event-istrusted">isTrusted</a></code> attribute initialized to true, its <code class="idl"><a data-link-type="idl" href="#dom-mediaquerylist-media" id="ref-for-dom-mediaquerylist-media-1">media</a></code> attribute initialized to <var>target</var>’s <a data-link-type="dfn" href="#mediaquerylist-media" id="ref-for-mediaquerylist-media-1">media</a>, and its <code class="idl"><a data-link-type="idl" href="#dom-mediaquerylistevent-matches" id="ref-for-dom-mediaquerylistevent-matches-1">matches</a></code> attribute initialized to <var>target</var>’s <a data-link-type="dfn" href="#mediaquerylist-matches-state" id="ref-for-mediaquerylist-matches-state-2">matches state</a>. </ol> </ol> <div class="example" id="example-74f03671"> <a class="self-link" href="#example-74f03671"></a> A simple piece of code that detects changes in the orientation of the viewport can be written as follows: <pre class="lang-javascript highlight"><span class="kd">function</span> <span class="nx">handleOrientationChange</span><span class="p">(</span><span class="nx">event</span><span class="p">)</span> <span class="p">{</span> <span class="k">if</span><span class="p">(</span><span class="nx">event</span><span class="p">.</span><span class="nx">matches</span><span class="p">)</span> <span class="c1">// landscape</span> <span class="err">…</span> <span class="k">else</span> <span class="err">…</span> <span class="p">}</span> <span class="kd">var</span> <span class="nx">mql</span> <span class="o">=</span> <span class="nx">matchMedia</span><span class="p">(</span><span class="s2">"(orientation:landscape)"</span><span class="p">);</span> <span class="nx">mql</span><span class="p">.</span><span class="nx">onchange</span> <span class="o">=</span> <span class="nx">handleOrientationChange</span><span class="p">;</span></pre> </div> <pre class="idl def">interface <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export="" data-lt="MediaQueryList" id="mediaquerylist">MediaQueryList<span class="dfn-panel" data-deco=""><b><a href="#mediaquerylist">#mediaquerylist</a></b><b>Referenced in:</b><span><a href="#ref-for-mediaquerylist-1">4. Extensions to the Window Interface</a> <a href="#ref-for-mediaquerylist-2">(2)</a></span><span><a href="#ref-for-mediaquerylist-3">4.2. The MediaQueryList Interface</a> <a href="#ref-for-mediaquerylist-4">(2)</a> <a href="#ref-for-mediaquerylist-5">(3)</a> <a href="#ref-for-mediaquerylist-6">(4)</a> <a href="#ref-for-mediaquerylist-7">(5)</a> <a href="#ref-for-mediaquerylist-8">(6)</a> <a href="#ref-for-mediaquerylist-9">(7)</a> <a href="#ref-for-mediaquerylist-10">(8)</a></span><span><a href="#ref-for-mediaquerylist-11">4.2.1. Event summary</a> <a href="#ref-for-mediaquerylist-12">(2)</a></span><span><a href="#ref-for-mediaquerylist-13">Changes From 17 December 2013</a> <a href="#ref-for-mediaquerylist-14">(2)</a></span></span></dfn> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget">EventTarget</a> { readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-mediaquerylist-media" id="ref-for-dom-mediaquerylist-media-2">media</a>; readonly attribute boolean <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="boolean " href="#dom-mediaquerylist-matches" id="ref-for-dom-mediaquerylist-matches-1">matches</a>; void <a class="idl-code" data-link-type="method" href="#dom-mediaquerylist-addlistener" id="ref-for-dom-mediaquerylist-addlistener-1">addListener</a>(<a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#callbackdef-eventlistener">EventListener</a>? <dfn class="idl-code" data-dfn-for="MediaQueryList/addListener(listener)" data-dfn-type="argument" data-export="" id="dom-mediaquerylist-addlistener-listener-listener">listener<a class="self-link" href="#dom-mediaquerylist-addlistener-listener-listener"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-mediaquerylist-removelistener" id="ref-for-dom-mediaquerylist-removelistener-1">removeListener</a>(<a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#callbackdef-eventlistener">EventListener</a>? <dfn class="idl-code" data-dfn-for="MediaQueryList/removeListener(listener)" data-dfn-type="argument" data-export="" id="dom-mediaquerylist-removelistener-listener-listener">listener<a class="self-link" href="#dom-mediaquerylist-removelistener-listener-listener"></a></dfn>); attribute <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler">EventHandler</a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler " href="#dom-mediaquerylist-onchange" id="ref-for-dom-mediaquerylist-onchange-1">onchange</a>; }; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MediaQueryList" data-dfn-type="attribute" data-export="" data-lt="media" id="dom-mediaquerylist-media">media<span class="dfn-panel" data-deco=""><b><a href="#dom-mediaquerylist-media">#dom-mediaquerylist-media</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mediaquerylist-media-1">4.2. The MediaQueryList Interface</a> <a href="#ref-for-dom-mediaquerylist-media-2">(2)</a></span></span></dfn> attribute must return the associated <a data-link-type="dfn" href="#mediaquerylist-media" id="ref-for-mediaquerylist-media-2">media</a>.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MediaQueryList" data-dfn-type="attribute" data-export="" data-lt="matches" id="dom-mediaquerylist-matches">matches<span class="dfn-panel" data-deco=""><b><a href="#dom-mediaquerylist-matches">#dom-mediaquerylist-matches</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mediaquerylist-matches-1">4.2. The MediaQueryList Interface</a></span></span></dfn> attribute must return the associated <a data-link-type="dfn" href="#mediaquerylist-matches-state" id="ref-for-mediaquerylist-matches-state-3">matches state</a>. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MediaQueryList" data-dfn-type="method" data-export="" data-lt="addListener(listener)" id="dom-mediaquerylist-addlistener">addListener(<var>listener</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-mediaquerylist-addlistener">#dom-mediaquerylist-addlistener</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mediaquerylist-addlistener-1">4.2. The MediaQueryList Interface</a> <a href="#ref-for-dom-mediaquerylist-addlistener-2">(2)</a> <a href="#ref-for-dom-mediaquerylist-addlistener-3">(3)</a></span><span><a href="#ref-for-dom-mediaquerylist-addlistener-4">Changes From 17 December 2013</a></span></span></dfn> method must run these steps:</p> <ol> <li data-md=""> <p>If <var>listener</var> is null, terminate these steps.</p> <li data-md=""> <p>Append an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-listener">event listener</a> to the associated list of <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-listener">event listeners</a> with <b>type</b> set to <code>change</code>, <b>callback</b> set to <var>listener</var>, and <b>capture</b> set to false, unless there already is an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-listener">event listener</a> in that list with the same <b>type</b>, <b>callback</b>, and <b>capture</b>.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MediaQueryList" data-dfn-type="method" data-export="" data-lt="removeListener(listener)" id="dom-mediaquerylist-removelistener">removeListener(<var>listener</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-mediaquerylist-removelistener">#dom-mediaquerylist-removelistener</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mediaquerylist-removelistener-1">4.2. The MediaQueryList Interface</a> <a href="#ref-for-dom-mediaquerylist-removelistener-2">(2)</a> <a href="#ref-for-dom-mediaquerylist-removelistener-3">(3)</a></span></span></dfn> method must run these steps:</p> <ol> <li data-md=""> <p>Remove an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-listener">event listener</a> from the associated list of <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-listener">event listeners</a>, whose <b>type</b> is <code>change</code>, <b>callback</b> is <var>listener</var>, and <b>capture</b> is false.</p> </ol> <p class="note" role="note">Note: This specification initially had a custom callback mechanism with <code class="idl"><a data-link-type="idl" href="#dom-mediaquerylist-addlistener" id="ref-for-dom-mediaquerylist-addlistener-2">addListener()</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-mediaquerylist-removelistener" id="ref-for-dom-mediaquerylist-removelistener-2">removeListener()</a></code>, and the callback was invoked with the associated media query list as argument. Now the normal event mechanism is used instead. For backwards compatibility, the <code class="idl"><a data-link-type="idl" href="#dom-mediaquerylist-addlistener" id="ref-for-dom-mediaquerylist-addlistener-3">addListener()</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-mediaquerylist-removelistener" id="ref-for-dom-mediaquerylist-removelistener-3">removeListener()</a></code> methods are basically aliases for <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener">addEventListener()</a></code> and <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener">removeEventListener()</a></code>, respectively, and the <code>change</code> event masquerades as a <code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-9">MediaQueryList</a></code>.</p> <p>The following are the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers">event handlers</a> (and their corresponding <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type">event handler event types</a>) that must be supported, as <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes">event handler IDL attributes</a>, by all objects implementing the <code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-10">MediaQueryList</a></code> interface:</p> <table class="complex data"> <thead> <tr> <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers">Event handler</a> <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type">Event handler event type</a> <tbody> <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="MediaQueryList" data-dfn-type="attribute" data-export="" data-lt="onchange" id="dom-mediaquerylist-onchange">onchange<span class="dfn-panel" data-deco=""><b><a href="#dom-mediaquerylist-onchange">#dom-mediaquerylist-onchange</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mediaquerylist-onchange-1">4.2. The MediaQueryList Interface</a></span></span></dfn> <td><a class="idl-code" data-link-type="event" href="#eventdef-mediaquerylist-change" id="ref-for-eventdef-mediaquerylist-change-2">change</a> </table> <pre class="idl def">[<dfn class="idl-code" data-dfn-for="MediaQueryListEvent" data-dfn-type="constructor" data-export="" data-lt="MediaQueryListEvent(type, eventInitDict)|MediaQueryListEvent(type)" id="dom-mediaquerylistevent-mediaquerylistevent">Constructor<a class="self-link" href="#dom-mediaquerylistevent-mediaquerylistevent"></a></dfn>(DOMString <dfn class="idl-code" data-dfn-for="MediaQueryListEvent/MediaQueryListEvent(type, eventInitDict)" data-dfn-type="argument" data-export="" id="dom-mediaquerylistevent-mediaquerylistevent-type-eventinitdict-type">type<a class="self-link" href="#dom-mediaquerylistevent-mediaquerylistevent-type-eventinitdict-type"></a></dfn>, optional <a data-link-type="idl-name" href="#dictdef-mediaquerylisteventinit" id="ref-for-dictdef-mediaquerylisteventinit-1">MediaQueryListEventInit</a> <dfn class="idl-code" data-dfn-for="MediaQueryListEvent/MediaQueryListEvent(type, eventInitDict)" data-dfn-type="argument" data-export="" id="dom-mediaquerylistevent-mediaquerylistevent-type-eventinitdict-eventinitdict">eventInitDict<a class="self-link" href="#dom-mediaquerylistevent-mediaquerylistevent-type-eventinitdict-eventinitdict"></a></dfn>)] interface <dfn class="idl-code" data-dfn-type="interface" data-export="" id="mediaquerylistevent">MediaQueryListEvent<a class="self-link" href="#mediaquerylistevent"></a></dfn> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event">Event</a> { readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-mediaquerylistevent-media" id="ref-for-dom-mediaquerylistevent-media-1">media</a>; readonly attribute boolean <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="boolean " href="#dom-mediaquerylistevent-matches" id="ref-for-dom-mediaquerylistevent-matches-2">matches</a>; }; dictionary <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export="" data-lt="MediaQueryListEventInit" id="dictdef-mediaquerylisteventinit">MediaQueryListEventInit<span class="dfn-panel" data-deco=""><b><a href="#dictdef-mediaquerylisteventinit">#dictdef-mediaquerylisteventinit</a></b><b>Referenced in:</b><span><a href="#ref-for-dictdef-mediaquerylisteventinit-1">4.2. The MediaQueryList Interface</a></span></span></dfn> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit">EventInit</a> { DOMString <dfn class="idl-code" data-default="""" data-dfn-for="MediaQueryListEventInit" data-dfn-type="dict-member" data-export="" data-type="DOMString " id="dom-mediaquerylisteventinit-media">media<a class="self-link" href="#dom-mediaquerylisteventinit-media"></a></dfn> = ""; boolean <dfn class="idl-code" data-default="false" data-dfn-for="MediaQueryListEventInit" data-dfn-type="dict-member" data-export="" data-type="boolean " id="dom-mediaquerylisteventinit-matches">matches<a class="self-link" href="#dom-mediaquerylisteventinit-matches"></a></dfn> = false; }; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MediaQueryListEvent" data-dfn-type="attribute" data-export="" data-lt="media" id="dom-mediaquerylistevent-media">media<span class="dfn-panel" data-deco=""><b><a href="#dom-mediaquerylistevent-media">#dom-mediaquerylistevent-media</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mediaquerylistevent-media-1">4.2. The MediaQueryList Interface</a></span></span></dfn> attribute must return the value it was initialized to.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MediaQueryListEvent" data-dfn-type="attribute" data-export="" data-lt="matches" id="dom-mediaquerylistevent-matches">matches<span class="dfn-panel" data-deco=""><b><a href="#dom-mediaquerylistevent-matches">#dom-mediaquerylistevent-matches</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mediaquerylistevent-matches-1">4.2. The MediaQueryList Interface</a> <a href="#ref-for-dom-mediaquerylistevent-matches-2">(2)</a></span></span></dfn> attribute must return the value it was initialized to.</p> <h4 class="heading settled" data-level="4.2.1" id="mediaquerylist-event-summary"><span class="secno">4.2.1. </span><span class="content">Event summary</span><a class="self-link" href="#mediaquerylist-event-summary"></a></h4> <p><i>This section is non-normative.</i></p> <table class="complex data"> <thead> <tr> <th>Event <th>Interface <th>Interesting targets <th>Description <tbody> <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="MediaQueryList" data-dfn-type="event" data-export="" data-lt="change" id="eventdef-mediaquerylist-change">change<span class="dfn-panel" data-deco=""><b><a href="#eventdef-mediaquerylist-change">#eventdef-mediaquerylist-change</a></b><b>Referenced in:</b><span><a href="#ref-for-eventdef-mediaquerylist-change-1">4.2. The MediaQueryList Interface</a> <a href="#ref-for-eventdef-mediaquerylist-change-2">(2)</a></span></span></dfn> <td><code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#event">Event</a></code> <td><code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-11">MediaQueryList</a></code> <td>Fired at the <code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-12">MediaQueryList</a></code> when the <a data-link-type="dfn" href="#mediaquerylist-matches-state" id="ref-for-mediaquerylist-matches-state-4">matches state</a> changes. </table> <h3 class="heading settled" data-level="4.3" id="the-screen-interface"><span class="secno">4.3. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#screen" id="ref-for-screen-3">Screen</a></code> Interface</span><a class="self-link" href="#the-screen-interface"></a></h3> <p>As its name suggests, the <code class="idl"><a data-link-type="idl" href="#screen" id="ref-for-screen-4">Screen</a></code> interface represents information about the screen of the output device.</p> <pre class="idl def">interface <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export="" data-lt="Screen" id="screen">Screen<span class="dfn-panel" data-deco=""><b><a href="#screen">#screen</a></b><b>Referenced in:</b><span><a href="#ref-for-screen-1">4. Extensions to the Window Interface</a> <a href="#ref-for-screen-2">(2)</a></span><span><a href="#ref-for-screen-3">4.3. The Screen Interface</a> <a href="#ref-for-screen-4">(2)</a></span><span><a href="#ref-for-screen-5">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> { readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-screen-availwidth" id="ref-for-dom-screen-availwidth-1">availWidth</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-screen-availheight" id="ref-for-dom-screen-availheight-1">availHeight</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-screen-width" id="ref-for-dom-screen-width-1">width</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-screen-height" id="ref-for-dom-screen-height-1">height</a>; readonly attribute unsigned long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long " href="#dom-screen-colordepth" id="ref-for-dom-screen-colordepth-1">colorDepth</a>; readonly attribute unsigned long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long " href="#dom-screen-pixeldepth" id="ref-for-dom-screen-pixeldepth-1">pixelDepth</a>; }; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Screen" data-dfn-type="attribute" data-export="" data-lt="availWidth" id="dom-screen-availwidth">availWidth<span class="dfn-panel" data-deco=""><b><a href="#dom-screen-availwidth">#dom-screen-availwidth</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-screen-availwidth-1">4.3. The Screen Interface</a></span></span></dfn> attribute must return the available width of the rendering surface of the output device, in CSS pixels. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Screen" data-dfn-type="attribute" data-export="" data-lt="availHeight" id="dom-screen-availheight">availHeight<span class="dfn-panel" data-deco=""><b><a href="#dom-screen-availheight">#dom-screen-availheight</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-screen-availheight-1">4.3. The Screen Interface</a></span></span></dfn> attribute must return the available height of the rendering surface of the output device, in CSS pixels. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Screen" data-dfn-type="attribute" data-export="" data-lt="width" id="dom-screen-width">width<span class="dfn-panel" data-deco=""><b><a href="#dom-screen-width">#dom-screen-width</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-screen-width-1">4.3. The Screen Interface</a></span></span></dfn> attribute must return the width of the output device, in CSS pixels. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Screen" data-dfn-type="attribute" data-export="" data-lt="height" id="dom-screen-height">height<span class="dfn-panel" data-deco=""><b><a href="#dom-screen-height">#dom-screen-height</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-screen-height-1">4.3. The Screen Interface</a></span></span></dfn> attribute must return the height of the output device, in CSS pixels. </p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Screen" data-dfn-type="attribute" data-export="" data-lt="colorDepth" id="dom-screen-colordepth">colorDepth<span class="dfn-panel" data-deco=""><b><a href="#dom-screen-colordepth">#dom-screen-colordepth</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-screen-colordepth-1">4.3. The Screen Interface</a> <a href="#ref-for-dom-screen-colordepth-2">(2)</a></span><span><a href="#ref-for-dom-screen-colordepth-3">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> attribute must return 24.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Screen" data-dfn-type="attribute" data-export="" data-lt="pixelDepth" id="dom-screen-pixeldepth">pixelDepth<span class="dfn-panel" data-deco=""><b><a href="#dom-screen-pixeldepth">#dom-screen-pixeldepth</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-screen-pixeldepth-1">4.3. The Screen Interface</a> <a href="#ref-for-dom-screen-pixeldepth-2">(2)</a></span><span><a href="#ref-for-dom-screen-pixeldepth-3">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> attribute must return 24.</p> <p class="note" role="note">Note: The <code class="idl"><a data-link-type="idl" href="#dom-screen-colordepth" id="ref-for-dom-screen-colordepth-2">colorDepth</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-screen-pixeldepth" id="ref-for-dom-screen-pixeldepth-2">pixelDepth</a></code> attributes are useless but are included for compatibility.</p> <h2 class="heading settled" data-level="5" id="extensions-to-the-document-interface"><span class="secno">5. </span><span class="content">Extensions to the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> Interface</span><a class="self-link" href="#extensions-to-the-document-interface"></a></h2> <pre class="idl def">partial interface <a class="idl-code" data-link-type="interface" href="https://dom.spec.whatwg.org/#document">Document</a> { <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a>? <a class="idl-code" data-link-type="method" href="#dom-document-elementfrompoint" id="ref-for-dom-document-elementfrompoint-1">elementFromPoint</a>(double <dfn class="idl-code" data-dfn-for="Document/elementFromPoint(x, y)" data-dfn-type="argument" data-export="" id="dom-document-elementfrompoint-x-y-x">x<a class="self-link" href="#dom-document-elementfrompoint-x-y-x"></a></dfn>, double <dfn class="idl-code" data-dfn-for="Document/elementFromPoint(x, y)" data-dfn-type="argument" data-export="" id="dom-document-elementfrompoint-x-y-y">y<a class="self-link" href="#dom-document-elementfrompoint-x-y-y"></a></dfn>); sequence<<a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a>> <a class="idl-code" data-link-type="method" href="#dom-document-elementsfrompoint" id="ref-for-dom-document-elementsfrompoint-1">elementsFromPoint</a>(double <dfn class="idl-code" data-dfn-for="Document/elementsFromPoint(x, y)" data-dfn-type="argument" data-export="" id="dom-document-elementsfrompoint-x-y-x">x<a class="self-link" href="#dom-document-elementsfrompoint-x-y-x"></a></dfn>, double <dfn class="idl-code" data-dfn-for="Document/elementsFromPoint(x, y)" data-dfn-type="argument" data-export="" id="dom-document-elementsfrompoint-x-y-y">y<a class="self-link" href="#dom-document-elementsfrompoint-x-y-y"></a></dfn>); <a data-link-type="idl-name" href="#caretposition" id="ref-for-caretposition-1">CaretPosition</a>? <a class="idl-code" data-link-type="method" href="#dom-document-caretpositionfrompoint" id="ref-for-dom-document-caretpositionfrompoint-1">caretPositionFromPoint</a>(double <dfn class="idl-code" data-dfn-for="Document/caretPositionFromPoint(x, y)" data-dfn-type="argument" data-export="" id="dom-document-caretpositionfrompoint-x-y-x">x<a class="self-link" href="#dom-document-caretpositionfrompoint-x-y-x"></a></dfn>, double <dfn class="idl-code" data-dfn-for="Document/caretPositionFromPoint(x, y)" data-dfn-type="argument" data-export="" id="dom-document-caretpositionfrompoint-x-y-y">y<a class="self-link" href="#dom-document-caretpositionfrompoint-x-y-y"></a></dfn>); readonly attribute <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Element? " href="#dom-document-scrollingelement" id="ref-for-dom-document-scrollingelement-1">scrollingElement</a>; }; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Document" data-dfn-type="method" data-export="" data-lt="elementFromPoint(x, y)" id="dom-document-elementfrompoint">elementFromPoint(<var>x</var>, <var>y</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-document-elementfrompoint">#dom-document-elementfrompoint</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-document-elementfrompoint-1">5. Extensions to the Document Interface</a> <a href="#ref-for-dom-document-elementfrompoint-2">(2)</a> <a href="#ref-for-dom-document-elementfrompoint-3">(3)</a></span></span></dfn> method must follow these steps:</p> <ol> <li data-md=""> <p>If either argument is negative, <var>x</var> is greater than the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-47">viewport</a> width excluding the size of a rendered scroll bar (if any), or <var>y</var> is greater than the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-48">viewport</a> height excluding the size of a rendered scroll bar (if any), or there is no <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-49">viewport</a> associated with the document, return null and terminate these steps.</p> <li data-md=""> <p>If there is a <a data-link-type="dfn" href="#layout-box" id="ref-for-layout-box-1">layout box</a> in the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-50">viewport</a> that would be a target for hit testing at coordinates <var>x</var>,<var>y</var>, when applying the <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-1">transforms</a> that apply to the descendants of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-51">viewport</a>, return the associated element and terminate these steps.</p> <li data-md=""> <p>If the document has a root element, return the root element and terminate these steps.</p> <li data-md=""> <p>Return null.</p> </ol> <p class="note" role="note">Note: The <code class="idl"><a data-link-type="idl" href="#dom-document-elementfrompoint" id="ref-for-dom-document-elementfrompoint-2">elementFromPoint()</a></code> method does not necessarily return the top-most painted element. For instance, an element can be excluded from being a target for hit testing by using the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/svg2/interact.html#PointerEventsProperty">pointer-events</a> CSS property.</p> <p class="atrisk"> The <dfn class="dfn-paneled idl-code" data-dfn-for="Document" data-dfn-type="method" data-export="" data-lt="elementsFromPoint(x, y)" id="dom-document-elementsfrompoint">elementsFromPoint(<var>x</var>, <var>y</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-document-elementsfrompoint">#dom-document-elementsfrompoint</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-document-elementsfrompoint-1">5. Extensions to the Document Interface</a></span><span><a href="#ref-for-dom-document-elementsfrompoint-2">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> method must follow these steps: </p> <ol> <li data-md=""> <p>Let <var>sequence</var> be a new empty sequence.</p> <li data-md=""> <p>If either argument is negative, <var>x</var> is greater than the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-52">viewport</a> width excluding the size of a rendered scroll bar (if any), or <var>y</var> is greater than the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-53">viewport</a> height excluding the size of a rendered scroll bar (if any), or there is no <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-54">viewport</a> associated with the document, return <var>sequence</var> and terminate these steps.</p> <li data-md=""> <p>For each <a data-link-type="dfn" href="#layout-box" id="ref-for-layout-box-2">layout box</a> in the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-55">viewport</a>, in paint order, starting with the topmost box, that would be a target for hit testing at coordinates <var>x</var>,<var>y</var> even if nothing would be overlapping it, when applying the <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-2">transforms</a> that apply to the descendants of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-56">viewport</a>, append the associated element to <var>sequence</var>.</p> <li data-md=""> <p>If the document has a root element, and the last item in <var>sequence</var> is not the root element, append the root element to <var>sequence</var>.</p> <li data-md=""> <p>Return <var>sequence</var>.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Document" data-dfn-type="method" data-export="" data-lt="caretPositionFromPoint(x, y)" id="dom-document-caretpositionfrompoint">caretPositionFromPoint(<var>x</var>, <var>y</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-document-caretpositionfrompoint">#dom-document-caretpositionfrompoint</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-document-caretpositionfrompoint-1">5. Extensions to the Document Interface</a> <a href="#ref-for-dom-document-caretpositionfrompoint-2">(2)</a></span></span></dfn> method must return the result of running these steps:</p> <ol> <li data-md=""> <p>If there is no <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-57">viewport</a> associated with the document, return null.</p> <li data-md=""> <p>If either argument is negative, <var>x</var> is greater than the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-58">viewport</a> width excluding the size of a rendered scroll bar (if any), <var>y</var> is greater than the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-59">viewport</a> height excluding the size of a rendered scroll bar (if any) return null.</p> <li data-md=""> <p>If at the coordinates <var>x</var>,<var>y</var> in the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-60">viewport</a> no text insertion point indicator would have been inserted when applying the <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-3">transforms</a> that apply to the descendants of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-61">viewport</a>, return null.</p> <li data-md=""> <p>If at the coordinates <var>x</var>,<var>y</var> in the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-62">viewport</a> a text insertion point indicator would have been inserted in a text entry widget which is also a replaced element, when applying the <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-4">transforms</a> that apply to the descendants of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-63">viewport</a>, return a <a data-link-type="dfn" href="#caret-position" id="ref-for-caret-position-1">caret position</a> with its properties set as follows:</p> <dl> <dt><a data-link-type="dfn" href="#caret-node" id="ref-for-caret-node-1">caret node</a> <dd>The node corresponding to the text entry widget. <dt><a data-link-type="dfn" href="#caret-offset" id="ref-for-caret-offset-1">caret offset</a> <dd>The amount of 16-bit units to the left of where the text insertion point indicator would have inserted. <dt><a data-link-type="dfn" href="#caret-range" id="ref-for-caret-range-1">caret range</a> <dd>null </dl> <li data-md=""> <p>Otherwise, return a <a data-link-type="dfn" href="#caret-position" id="ref-for-caret-position-2">caret position</a> where the <a data-link-type="dfn" href="#caret-range" id="ref-for-caret-range-2">caret range</a> is a collapsed <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#range">Range</a></code> object for the position where the text insertion point indicator would have been inserted when applying the <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-5">transforms</a> that apply to the descendants of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-64">viewport</a>, and the other properties are set as follows:</p> <dl> <dt><a data-link-type="dfn" href="#caret-node" id="ref-for-caret-node-2">caret node</a> <dd>The <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-range-startcontainer">startContainer</a></code> of the <a data-link-type="dfn" href="#caret-range" id="ref-for-caret-range-3">caret range</a>. <dt><a data-link-type="dfn" href="#caret-offset" id="ref-for-caret-offset-2">caret offset</a> <dd>The <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-range-startoffset">startOffset</a></code> of the <a data-link-type="dfn" href="#caret-range" id="ref-for-caret-range-4">caret range</a>. </dl> </ol> <p class="note" role="note">Note: The specifics of hit testing are out of scope of this specification and therefore the exact details of <code class="idl"><a data-link-type="idl" href="#dom-document-elementfrompoint" id="ref-for-dom-document-elementfrompoint-3">elementFromPoint()</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-document-caretpositionfrompoint" id="ref-for-dom-document-caretpositionfrompoint-2">caretPositionFromPoint()</a></code> are therefore too. Hit testing will hopefully be defined in a future revision of CSS or HTML.</p> <p class="atrisk">The <dfn class="dfn-paneled idl-code" data-dfn-for="Document" data-dfn-type="attribute" data-export="" data-lt="scrollingElement" id="dom-document-scrollingelement">scrollingElement<span class="dfn-panel" data-deco=""><b><a href="#dom-document-scrollingelement">#dom-document-scrollingelement</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-document-scrollingelement-1">5. Extensions to the Document Interface</a> <a href="#ref-for-dom-document-scrollingelement-2">(2)</a></span><span><a href="#ref-for-dom-document-scrollingelement-3">Changes From 17 December 2013</a></span></span></dfn> attribute, on getting, must run these steps: </p> <ol> <li data-md=""> <p>If the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, follow these substeps:</p> <ol> <li data-md=""> <p>If <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-2">the HTML <code>body</code> element</a> exists, and it is not <a data-link-type="dfn" href="#potentially-scrollable" id="ref-for-potentially-scrollable-2">potentially scrollable</a>, return <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-3">the HTML <code>body</code> element</a> and abort these steps.</p> <li data-md=""> <p>Return null and abort these steps.</p> </ol> <li data-md=""> <p>If there is a root element, return the root element and abort these steps.</p> <li data-md=""> <p>Return null.</p> </ol> <p class="note" role="note">Note: For non-conforming user agents that always use the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a> behavior for <code class="idl"><a data-link-type="idl" href="#dom-element-scrolltop" id="ref-for-dom-element-scrolltop-1">scrollTop</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-element-scrollleft" id="ref-for-dom-element-scrollleft-1">scrollLeft</a></code>, the <code class="idl"><a data-link-type="idl" href="#dom-document-scrollingelement" id="ref-for-dom-document-scrollingelement-2">scrollingElement</a></code> attribute is expected to also always return <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-4">the HTML <code>body</code> element</a> (or null if it does not exist). This API exists so that Web developers can use it to get the right element to use for scrolling APIs, without making assumptions about a particular user agent’s behavior or having to invoke a scroll to see which element scrolls the viewport.</p> <p class="note" role="note">Note: <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-5">The HTML <code>body</code> element</a> is different from HTML’s <code>document.body</code> in that the latter can return a <code>frameset</code> element.</p> <h3 class="heading settled" data-level="5.1" id="the-caretposition-interface"><span class="secno">5.1. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#caretposition" id="ref-for-caretposition-2">CaretPosition</a></code> Interface</span><a class="self-link" href="#the-caretposition-interface"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="caret position" data-noexport="" id="caret-position">caret position<span class="dfn-panel" data-deco=""><b><a href="#caret-position">#caret-position</a></b><b>Referenced in:</b><span><a href="#ref-for-caret-position-1">5. Extensions to the Document Interface</a> <a href="#ref-for-caret-position-2">(2)</a></span></span></dfn> gives the position of a text insertion point indicator. It always has an associated <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="caret node" data-noexport="" id="caret-node">caret node<span class="dfn-panel" data-deco=""><b><a href="#caret-node">#caret-node</a></b><b>Referenced in:</b><span><a href="#ref-for-caret-node-1">5. Extensions to the Document Interface</a> <a href="#ref-for-caret-node-2">(2)</a></span><span><a href="#ref-for-caret-node-3">5.1. The CaretPosition Interface</a> <a href="#ref-for-caret-node-4">(2)</a></span></span></dfn>, <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="caret offset" data-noexport="" id="caret-offset">caret offset<span class="dfn-panel" data-deco=""><b><a href="#caret-offset">#caret-offset</a></b><b>Referenced in:</b><span><a href="#ref-for-caret-offset-1">5. Extensions to the Document Interface</a> <a href="#ref-for-caret-offset-2">(2)</a></span><span><a href="#ref-for-caret-offset-3">5.1. The CaretPosition Interface</a> <a href="#ref-for-caret-offset-4">(2)</a></span></span></dfn>, and <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="caret range" data-noexport="" id="caret-range">caret range<span class="dfn-panel" data-deco=""><b><a href="#caret-range">#caret-range</a></b><b>Referenced in:</b><span><a href="#ref-for-caret-range-1">5. Extensions to the Document Interface</a> <a href="#ref-for-caret-range-2">(2)</a> <a href="#ref-for-caret-range-3">(3)</a> <a href="#ref-for-caret-range-4">(4)</a></span><span><a href="#ref-for-caret-range-5">5.1. The CaretPosition Interface</a></span></span></dfn>. It is represented by a <code class="idl"><a data-link-type="idl" href="#caretposition" id="ref-for-caretposition-3">CaretPosition</a></code> object.</p> <pre class="idl def">interface <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export="" data-lt="CaretPosition" id="caretposition">CaretPosition<span class="dfn-panel" data-deco=""><b><a href="#caretposition">#caretposition</a></b><b>Referenced in:</b><span><a href="#ref-for-caretposition-1">5. Extensions to the Document Interface</a></span><span><a href="#ref-for-caretposition-2">5.1. The CaretPosition Interface</a> <a href="#ref-for-caretposition-3">(2)</a></span></span></dfn> { readonly attribute <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#node">Node</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Node " href="#dom-caretposition-offsetnode" id="ref-for-dom-caretposition-offsetnode-1">offsetNode</a>; readonly attribute unsigned long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long " href="#dom-caretposition-offset" id="ref-for-dom-caretposition-offset-1">offset</a>; [NewObject] <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a>? <a class="idl-code" data-link-type="method" href="#dom-caretposition-getclientrect" id="ref-for-dom-caretposition-getclientrect-1">getClientRect</a>(); }; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="CaretPosition" data-dfn-type="attribute" data-export="" data-lt="offsetNode" id="dom-caretposition-offsetnode">offsetNode<span class="dfn-panel" data-deco=""><b><a href="#dom-caretposition-offsetnode">#dom-caretposition-offsetnode</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-caretposition-offsetnode-1">5.1. The CaretPosition Interface</a></span></span></dfn> attribute must return the <a data-link-type="dfn" href="#caret-node" id="ref-for-caret-node-3">caret node</a>.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="CaretPosition" data-dfn-type="attribute" data-export="" data-lt="offset" id="dom-caretposition-offset">offset<span class="dfn-panel" data-deco=""><b><a href="#dom-caretposition-offset">#dom-caretposition-offset</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-caretposition-offset-1">5.1. The CaretPosition Interface</a></span></span></dfn> attribute must return the <a data-link-type="dfn" href="#caret-offset" id="ref-for-caret-offset-3">caret offset</a>.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="CaretPosition" data-dfn-type="method" data-export="" data-lt="getClientRect()" id="dom-caretposition-getclientrect">getClientRect()<span class="dfn-panel" data-deco=""><b><a href="#dom-caretposition-getclientrect">#dom-caretposition-getclientrect</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-caretposition-getclientrect-1">5.1. The CaretPosition Interface</a></span></span></dfn> method must follow these steps, aborting on the first step that returns a value:</p> <ol> <li data-md=""> <p>If <a data-link-type="dfn" href="#caret-range" id="ref-for-caret-range-5">caret range</a> is not null:</p> <ol> <li data-md=""> <p>Let <var>list</var> be the result of invoking the <code class="idl"><a data-link-type="idl" href="#dom-range-getclientrects" id="ref-for-dom-range-getclientrects-1">getClientRects()</a></code> method on the range.</p> <li data-md=""> <p>If <var>list</var> is empty, return null.</p> <li data-md=""> <p>Return the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> object in <var>list</var> at index 0.</p> </ol> <li data-md=""> <p>If <a data-link-type="dfn" href="#caret-node" id="ref-for-caret-node-4">caret node</a> is a text entry widget that is a replaced element, and that is in the document, return a static <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> object for the caret in the widget as represented by the <a data-link-type="dfn" href="#caret-offset" id="ref-for-caret-offset-4">caret offset</a> value. The <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-6">transforms</a> that apply to the element and its ancestors are applied.</p> <li data-md=""> <p>Return null.</p> </ol> <h2 class="heading settled" data-level="6" id="extension-to-the-element-interface"><span class="secno">6. </span><span class="content">Extensions to the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element">Element</a></code> Interface</span><a class="self-link" href="#extension-to-the-element-interface"></a></h2> <pre class="idl def">enum <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export="" data-lt="ScrollLogicalPosition" id="enumdef-scrolllogicalposition">ScrollLogicalPosition<span class="dfn-panel" data-deco=""><b><a href="#enumdef-scrolllogicalposition">#enumdef-scrolllogicalposition</a></b><b>Referenced in:</b><span><a href="#ref-for-enumdef-scrolllogicalposition-1">6. Extensions to the Element Interface</a> <a href="#ref-for-enumdef-scrolllogicalposition-2">(2)</a></span></span></dfn> { <dfn class="idl-code" data-dfn-for="ScrollLogicalPosition" data-dfn-type="enum-value" data-export="" id="dom-scrolllogicalposition-start">"start"<a class="self-link" href="#dom-scrolllogicalposition-start"></a></dfn>, <dfn class="idl-code" data-dfn-for="ScrollLogicalPosition" data-dfn-type="enum-value" data-export="" id="dom-scrolllogicalposition-center">"center"<a class="self-link" href="#dom-scrolllogicalposition-center"></a></dfn>, <dfn class="idl-code" data-dfn-for="ScrollLogicalPosition" data-dfn-type="enum-value" data-export="" id="dom-scrolllogicalposition-end">"end"<a class="self-link" href="#dom-scrolllogicalposition-end"></a></dfn>, <dfn class="idl-code" data-dfn-for="ScrollLogicalPosition" data-dfn-type="enum-value" data-export="" id="dom-scrolllogicalposition-nearest">"nearest"<a class="self-link" href="#dom-scrolllogicalposition-nearest"></a></dfn> }; dictionary <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export="" data-lt="ScrollIntoViewOptions" id="dictdef-scrollintoviewoptions">ScrollIntoViewOptions<span class="dfn-panel" data-deco=""><b><a href="#dictdef-scrollintoviewoptions">#dictdef-scrollintoviewoptions</a></b><b>Referenced in:</b><span><a href="#ref-for-dictdef-scrollintoviewoptions-1">6. Extensions to the Element Interface</a></span><span><a href="#ref-for-dictdef-scrollintoviewoptions-2">6.1. Element Scrolling Members</a></span></span></dfn> : <a data-link-type="idl-name" href="#dictdef-scrolloptions" id="ref-for-dictdef-scrolloptions-2">ScrollOptions</a> { <a data-link-type="idl-name" href="#enumdef-scrolllogicalposition" id="ref-for-enumdef-scrolllogicalposition-1">ScrollLogicalPosition</a> <dfn class="dfn-paneled idl-code" data-default=""center"" data-dfn-for="ScrollIntoViewOptions" data-dfn-type="dict-member" data-export="" data-lt="block" data-type="ScrollLogicalPosition " id="dom-scrollintoviewoptions-block">block<span class="dfn-panel" data-deco=""><b><a href="#dom-scrollintoviewoptions-block">#dom-scrollintoviewoptions-block</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-scrollintoviewoptions-block-1">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-scrollintoviewoptions-block-2">(2)</a></span><span><a href="#ref-for-dom-scrollintoviewoptions-block-3">6.1. Element Scrolling Members</a> <a href="#ref-for-dom-scrollintoviewoptions-block-4">(2)</a> <a href="#ref-for-dom-scrollintoviewoptions-block-5">(3)</a></span></span></dfn> = "center"; <a data-link-type="idl-name" href="#enumdef-scrolllogicalposition" id="ref-for-enumdef-scrolllogicalposition-2">ScrollLogicalPosition</a> <dfn class="dfn-paneled idl-code" data-default=""center"" data-dfn-for="ScrollIntoViewOptions" data-dfn-type="dict-member" data-export="" data-lt="inline" data-type="ScrollLogicalPosition " id="dom-scrollintoviewoptions-inline">inline<span class="dfn-panel" data-deco=""><b><a href="#dom-scrollintoviewoptions-inline">#dom-scrollintoviewoptions-inline</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-scrollintoviewoptions-inline-1">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-scrollintoviewoptions-inline-2">(2)</a></span><span><a href="#ref-for-dom-scrollintoviewoptions-inline-3">6.1. Element Scrolling Members</a> <a href="#ref-for-dom-scrollintoviewoptions-inline-4">(2)</a> <a href="#ref-for-dom-scrollintoviewoptions-inline-5">(3)</a></span></span></dfn> = "center"; }; partial interface <a class="idl-code" data-link-type="interface" href="https://dom.spec.whatwg.org/#element">Element</a> { sequence<<a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a>> <a class="idl-code" data-link-type="method" href="#dom-element-getclientrects" id="ref-for-dom-element-getclientrects-1">getClientRects</a>(); [NewObject] <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a> <a class="idl-code" data-link-type="method" href="#dom-element-getboundingclientrect" id="ref-for-dom-element-getboundingclientrect-1">getBoundingClientRect</a>(); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollintoview" id="ref-for-dom-element-scrollintoview-1">scrollIntoView</a>(); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollintoview" id="ref-for-dom-element-scrollintoview-2">scrollIntoView</a>((boolean or object) <dfn class="idl-code" data-dfn-for="Element/scrollIntoView(arg)" data-dfn-type="argument" data-export="" id="dom-element-scrollintoview-arg-arg">arg<a class="self-link" href="#dom-element-scrollintoview-arg-arg"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-element-scroll" id="ref-for-dom-element-scroll-1">scroll</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions" id="ref-for-dictdef-scrolltooptions-6">ScrollToOptions</a> <dfn class="idl-code" data-dfn-for="Element/scroll(options), Element/scroll()" data-dfn-type="argument" data-export="" id="dom-element-scroll-options-options">options<a class="self-link" href="#dom-element-scroll-options-options"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-element-scroll" id="ref-for-dom-element-scroll-2">scroll</a>(unrestricted double <dfn class="idl-code" data-dfn-for="Element/scroll(x, y)" data-dfn-type="argument" data-export="" id="dom-element-scroll-x-y-x">x<a class="self-link" href="#dom-element-scroll-x-y-x"></a></dfn>, unrestricted double <dfn class="idl-code" data-dfn-for="Element/scroll(x, y)" data-dfn-type="argument" data-export="" id="dom-element-scroll-x-y-y">y<a class="self-link" href="#dom-element-scroll-x-y-y"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollto" id="ref-for-dom-element-scrollto-1">scrollTo</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions" id="ref-for-dictdef-scrolltooptions-7">ScrollToOptions</a> <dfn class="idl-code" data-dfn-for="Element/scrollTo(options), Element/scrollTo()" data-dfn-type="argument" data-export="" id="dom-element-scrollto-options-options">options<a class="self-link" href="#dom-element-scrollto-options-options"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollto" id="ref-for-dom-element-scrollto-2">scrollTo</a>(unrestricted double <dfn class="idl-code" data-dfn-for="Element/scrollTo(x, y)" data-dfn-type="argument" data-export="" id="dom-element-scrollto-x-y-x">x<a class="self-link" href="#dom-element-scrollto-x-y-x"></a></dfn>, unrestricted double <dfn class="idl-code" data-dfn-for="Element/scrollTo(x, y)" data-dfn-type="argument" data-export="" id="dom-element-scrollto-x-y-y">y<a class="self-link" href="#dom-element-scrollto-x-y-y"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollby" id="ref-for-dom-element-scrollby-1">scrollBy</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions" id="ref-for-dictdef-scrolltooptions-8">ScrollToOptions</a> <dfn class="idl-code" data-dfn-for="Element/scrollBy(options), Element/scrollBy()" data-dfn-type="argument" data-export="" id="dom-element-scrollby-options-options">options<a class="self-link" href="#dom-element-scrollby-options-options"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollby" id="ref-for-dom-element-scrollby-2">scrollBy</a>(unrestricted double <dfn class="idl-code" data-dfn-for="Element/scrollBy(x, y)" data-dfn-type="argument" data-export="" id="dom-element-scrollby-x-y-x">x<a class="self-link" href="#dom-element-scrollby-x-y-x"></a></dfn>, unrestricted double <dfn class="idl-code" data-dfn-for="Element/scrollBy(x, y)" data-dfn-type="argument" data-export="" id="dom-element-scrollby-x-y-y">y<a class="self-link" href="#dom-element-scrollby-x-y-y"></a></dfn>); attribute unrestricted double <a class="idl-code" data-link-type="attribute" data-type="unrestricted double " href="#dom-element-scrolltop" id="ref-for-dom-element-scrolltop-2">scrollTop</a>; attribute unrestricted double <a class="idl-code" data-link-type="attribute" data-type="unrestricted double " href="#dom-element-scrollleft" id="ref-for-dom-element-scrollleft-2">scrollLeft</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-scrollwidth" id="ref-for-dom-element-scrollwidth-1">scrollWidth</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-scrollheight" id="ref-for-dom-element-scrollheight-1">scrollHeight</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-clienttop" id="ref-for-dom-element-clienttop-1">clientTop</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-clientleft" id="ref-for-dom-element-clientleft-1">clientLeft</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-clientwidth" id="ref-for-dom-element-clientwidth-1">clientWidth</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-clientheight" id="ref-for-dom-element-clientheight-1">clientHeight</a>; }; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="method" data-export="" data-lt="getClientRects()" id="dom-element-getclientrects">getClientRects()<span class="dfn-panel" data-deco=""><b><a href="#dom-element-getclientrects">#dom-element-getclientrects</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-getclientrects-1">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-element-getclientrects-2">(2)</a></span><span><a href="#ref-for-dom-element-getclientrects-3">9. Extensions to the Range Interface</a></span></span></dfn> method, when invoked, must return the result of the following algorithm:</p> <ol> <li data-md=""> <p>If the element on which it was invoked does not have an associated <a data-link-type="dfn" href="#layout-box" id="ref-for-layout-box-3">layout box</a> return an empty sequence and stop this algorithm.</p> <li data-md=""> <p>If the element has an associated <a data-link-type="dfn" href="#svg-layout-box" id="ref-for-svg-layout-box-3">SVG layout box</a> return a sequence containing a single <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> object that describes the bounding box of the element as defined by the SVG specification, applying the <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-7">transforms</a> that apply to the element and its ancestors.</p> <li data-md=""> <p>Return a sequence containing static <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> objects in content order, one for each <a data-link-type="dfn" href="https://www.w3.org/TR/css3-break/#box-fragment">box fragment</a>, describing its border area (including those with a height or width of zero) with the following constraints:</p> <ul> <li data-md=""> <p>Apply the <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-8">transforms</a> that apply to the element and its ancestors.</p> <li data-md=""> <p>If the element on which the method was invoked has a computed value for the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/CSS21/visuren.html#propdef-display">display</a> property of <a class="css" data-link-type="maybe" href="https://www.w3.org/TR/css-display-3/#valdef-display-table">table</a> or <a class="css" data-link-type="maybe" href="https://www.w3.org/TR/css-display-3/#valdef-display-inline-table">inline-table</a> include both the table box and the caption box, if any, but not the anonymous container box.</p> <li data-md=""> <p>Replace each <a data-link-type="dfn" href="https://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level">anonymous block box</a> with its child box(es) and repeat this until no anonymous block boxes are left in the final list.</p> </ul> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="method" data-export="" data-lt="getBoundingClientRect()" id="dom-element-getboundingclientrect">getBoundingClientRect()<span class="dfn-panel" data-deco=""><b><a href="#dom-element-getboundingclientrect">#dom-element-getboundingclientrect</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-getboundingclientrect-1">6. Extensions to the Element Interface</a></span><span><a href="#ref-for-dom-element-getboundingclientrect-2">6.1. Element Scrolling Members</a></span></span></dfn> method, when invoked, must return the result of the following algorithm:</p> <ol> <li data-md=""> <p>Let <var>list</var> be the result of invoking <code class="idl"><a data-link-type="idl" href="#dom-element-getclientrects" id="ref-for-dom-element-getclientrects-2">getClientRects()</a></code> on the same element this method was invoked on.</p> <li data-md=""> <p>If the <var>list</var> is empty return a static <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> object whose <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-domrect-x">x</a></code>, <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-domrect-y">y</a></code>, <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-domrect-width">width</a></code> and <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-domrect-height">height</a></code> members are zero.</p> <li data-md=""> <p>Otherwise, return a static <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> object describing the smallest rectangle that includes the first rectangle in <var>list</var> and all of the remaining rectangles of which the height or width is not zero.</p> </ol> <div class="example" id="example-53bedd73"> <a class="self-link" href="#example-53bedd73"></a> The following snippet gets the dimensions of the first <code>div</code> element in a document: <pre class="lang-javascript highlight"><span class="kd">var</span> <span class="nx">example</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s2">"div"</span><span class="p">)[</span><span class="mi">0</span><span class="p">].</span><span class="nx">getBoundingClientRect</span><span class="p">();</span> <span class="kd">var</span> <span class="nx">exampleWidth</span> <span class="o">=</span> <span class="nx">example</span><span class="p">.</span><span class="nx">width</span><span class="p">;</span> <span class="kd">var</span> <span class="nx">exampleHeight</span> <span class="o">=</span> <span class="nx">example</span><span class="p">.</span><span class="nx">height</span><span class="p">;</span></pre> </div> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="method" data-export="" data-lt="scrollIntoView(arg)" id="dom-element-scrollintoview">scrollIntoView(<var>arg</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-element-scrollintoview">#dom-element-scrollintoview</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-scrollintoview-1">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-element-scrollintoview-2">(2)</a></span><span><a href="#ref-for-dom-element-scrollintoview-3">Changes From 17 December 2013</a> <a href="#ref-for-dom-element-scrollintoview-4">(2)</a></span></span></dfn> method must run these steps:</p> <ol> <li data-md=""> <p>Let <var>options</var> be null.</p> <li data-md=""> <p>If <var>arg</var> is an object, let <var>options</var> be <var>arg</var>.</p> <li data-md=""> <p><a data-link-type="dfn" href="http://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value">Convert</a> <var>options</var> to a <code class="idl"><a data-link-type="idl" href="#dictdef-scrollintoviewoptions" id="ref-for-dictdef-scrollintoviewoptions-1">ScrollIntoViewOptions</a></code> dictionary. <a data-link-type="biblio" href="#biblio-webidl">[WEBIDL]</a></p> <li data-md=""> <p>If <var>arg</var> is not specified or is true, let the <code class="idl"><a data-link-type="idl" href="#dom-scrollintoviewoptions-block" id="ref-for-dom-scrollintoviewoptions-block-1">block</a></code> dictionary member of <var>options</var> have the value "<code>start</code>", and let the <code class="idl"><a data-link-type="idl" href="#dom-scrollintoviewoptions-inline" id="ref-for-dom-scrollintoviewoptions-inline-1">inline</a></code> dictionary member of <var>options</var> have the value "<code>nearest</code>".</p> <li data-md=""> <p>If <var>arg</var> is false, let the <code class="idl"><a data-link-type="idl" href="#dom-scrollintoviewoptions-block" id="ref-for-dom-scrollintoviewoptions-block-2">block</a></code> dictionary member of <var>options</var> have the value "<code>end</code>", and let the <code class="idl"><a data-link-type="idl" href="#dom-scrollintoviewoptions-inline" id="ref-for-dom-scrollintoviewoptions-inline-2">inline</a></code> dictionary member of <var>options</var> have the value "<code>nearest</code>".</p> <li data-md=""> <p>If the element does not have any associated <a data-link-type="dfn" href="#layout-box" id="ref-for-layout-box-4">layout box</a> terminate these steps.</p> <li data-md=""> <p><a data-link-type="dfn" href="#scroll-an-element-into-view" id="ref-for-scroll-an-element-into-view-1">Scroll the element into view</a> with the options <var>options</var>.</p> <li data-md=""> <p>Optionally perform some other action that brings the element to the user’s attention.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="method" data-export="" data-lt="scroll(options)|scroll(x, y)" id="dom-element-scroll">scroll()<span class="dfn-panel" data-deco=""><b><a href="#dom-element-scroll">#dom-element-scroll</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-scroll-1">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-element-scroll-2">(2)</a> <a href="#ref-for-dom-element-scroll-3">(3)</a> <a href="#ref-for-dom-element-scroll-4">(4)</a></span><span><a href="#ref-for-dom-element-scroll-5">Changes From 17 December 2013</a></span></span></dfn> method must run these steps:</p> <ol> <li data-md=""> <p>If invoked with one argument, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>options</var> be the argument.</p> <li data-md=""> <p><a data-link-type="dfn" href="#normalize-non-finite-values" id="ref-for-normalize-non-finite-values-3">Normalize non-finite values</a> for <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-left" id="ref-for-dom-scrolltooptions-left-5">left</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-top" id="ref-for-dom-scrolltooptions-top-5">top</a></code> dictionary members of <var>options</var>, if present.</p> <li data-md=""> <p>Let <var>x</var> be the value of the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-left" id="ref-for-dom-scrolltooptions-left-6">left</a></code> dictionary member of <var>options</var>, if present, or the element’s current scroll position on the x axis otherwise.</p> <li data-md=""> <p>Let <var>y</var> be the value of the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-top" id="ref-for-dom-scrolltooptions-top-6">top</a></code> dictionary member of <var>options</var>, if present, or the element’s current scroll position on the y axis otherwise.</p> </ol> <li data-md=""> <p>If invoked with two arguments, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>options</var> be null <a data-link-type="dfn" href="http://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value">converted</a> to a <code class="idl"><a data-link-type="idl" href="#dictdef-scrolltooptions" id="ref-for-dictdef-scrolltooptions-9">ScrollToOptions</a></code> dictionary. <a data-link-type="biblio" href="#biblio-webidl">[WEBIDL]</a></p> <li data-md=""> <p>Let <var>x</var> and <var>y</var> be the arguments, respectively.</p> <li data-md=""> <p><a data-link-type="dfn" href="#normalize-non-finite-values" id="ref-for-normalize-non-finite-values-4">Normalize non-finite values</a> for <var>x</var> and <var>y</var>.</p> <li data-md=""> <p>Let the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-left" id="ref-for-dom-scrolltooptions-left-7">left</a></code> dictionary member of <var>options</var> have the value <var>x</var>.</p> <li data-md=""> <p>Let the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-top" id="ref-for-dom-scrolltooptions-top-7">top</a></code> dictionary member of <var>options</var> have the value <var>y</var>.</p> </ol> <li data-md=""> <p>Let <var>document</var> be the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>.</p> <li data-md=""> <p>If <var>document</var> is not the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">active document</a>, terminate these steps.</p> <li data-md=""> <p>Let <var>window</var> be the value of <var>document</var>’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#dom-document-defaultview">defaultView</a></code> attribute.</p> <li data-md=""> <p>If <var>window</var> is null, terminate these steps.</p> <li data-md=""> <p>If the element is the root element and <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, terminate these steps.</p> <li data-md=""> <p>If the element is the root element invoke <code class="idl"><a data-link-type="idl" href="#dom-window-scroll" id="ref-for-dom-window-scroll-5">scroll()</a></code> on <var>window</var> with <code class="idl"><a data-link-type="idl" href="#dom-window-scrollx" id="ref-for-dom-window-scrollx-4">scrollX</a></code> on <var>window</var> as first argument and <var>y</var> as second argument, and terminate these steps.</p> <li data-md=""> <p>If the element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-6">the HTML <code>body</code> element</a>, <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, and the element is not <a data-link-type="dfn" href="#potentially-scrollable" id="ref-for-potentially-scrollable-3">potentially scrollable</a>, invoke <code class="idl"><a data-link-type="idl" href="#dom-window-scroll" id="ref-for-dom-window-scroll-6">scroll()</a></code> on <var>window</var> with <var>options</var> as the only argument, and terminate these steps.</p> <li data-md=""> <p>If the element does not have any associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-5">CSS layout box</a>, the element has no associated <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-7">scrolling box</a>, or the element has no overflow, terminate these steps.</p> <li data-md=""> <p><a data-link-type="dfn" href="#scroll-an-element" id="ref-for-scroll-an-element-1">Scroll the element</a> to <var>x</var>,<var>y</var>, with the scroll behavior being the value of the <code class="idl"><a data-link-type="idl" href="#dom-scrolloptions-behavior" id="ref-for-dom-scrolloptions-behavior-2">behavior</a></code> dictionary member of <var>options</var>.</p> </ol> <p>When the <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="method" data-export="" data-lt="scrollTo(options)|scrollTo(x, y)" id="dom-element-scrollto">scrollTo()<span class="dfn-panel" data-deco=""><b><a href="#dom-element-scrollto">#dom-element-scrollto</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-scrollto-1">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-element-scrollto-2">(2)</a></span><span><a href="#ref-for-dom-element-scrollto-3">Changes From 17 December 2013</a></span></span></dfn> method is invoked, the user agent must act as if the <code class="idl"><a data-link-type="idl" href="#dom-element-scroll" id="ref-for-dom-element-scroll-3">scroll()</a></code> method was invoked with the same arguments.</p> <p>When the <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="method" data-export="" data-lt="scrollBy(options)|scrollBy(x, y)" id="dom-element-scrollby">scrollBy()<span class="dfn-panel" data-deco=""><b><a href="#dom-element-scrollby">#dom-element-scrollby</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-scrollby-1">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-element-scrollby-2">(2)</a></span><span><a href="#ref-for-dom-element-scrollby-3">Changes From 17 December 2013</a></span></span></dfn> method is invoked, the user agent must run these steps:</p> <ol> <li data-md=""> <p>If invoked with one argument, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>options</var> be the argument.</p> <li data-md=""> <p><a data-link-type="dfn" href="#normalize-non-finite-values" id="ref-for-normalize-non-finite-values-5">Normalize non-finite values</a> for <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-left" id="ref-for-dom-scrolltooptions-left-8">left</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-top" id="ref-for-dom-scrolltooptions-top-8">top</a></code> dictionary members of <var>options</var>, if present.</p> </ol> <li data-md=""> <p>If invoked with two arguments, follow these substeps:</p> <ol> <li data-md=""> <p>Let <var>options</var> be null <a data-link-type="dfn" href="http://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value">converted</a> to a <code class="idl"><a data-link-type="idl" href="#dictdef-scrolltooptions" id="ref-for-dictdef-scrolltooptions-10">ScrollToOptions</a></code> dictionary. <a data-link-type="biblio" href="#biblio-webidl">[WEBIDL]</a></p> <li data-md=""> <p>Let <var>x</var> and <var>y</var> be the arguments, respectively.</p> <li data-md=""> <p><a data-link-type="dfn" href="#normalize-non-finite-values" id="ref-for-normalize-non-finite-values-6">Normalize non-finite values</a> for <var>x</var> and <var>y</var>.</p> <li data-md=""> <p>Let the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-left" id="ref-for-dom-scrolltooptions-left-9">left</a></code> dictionary member of <var>options</var> have the value <var>x</var>.</p> <li data-md=""> <p>Let the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-top" id="ref-for-dom-scrolltooptions-top-9">top</a></code> dictionary member of <var>options</var> have the value <var>y</var>.</p> </ol> <li data-md=""> <p>Add the value of <code class="idl"><a data-link-type="idl" href="#dom-element-scrollleft" id="ref-for-dom-element-scrollleft-3">scrollLeft</a></code> to the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-left" id="ref-for-dom-scrolltooptions-left-10">left</a></code> dictionary member.</p> <li data-md=""> <p>Add the value of <code class="idl"><a data-link-type="idl" href="#dom-element-scrolltop" id="ref-for-dom-element-scrolltop-3">scrollTop</a></code> to the <code class="idl"><a data-link-type="idl" href="#dom-scrolltooptions-top" id="ref-for-dom-scrolltooptions-top-10">top</a></code> dictionary member.</p> <li data-md=""> <p>Act as if the <code class="idl"><a data-link-type="idl" href="#dom-element-scroll" id="ref-for-dom-element-scroll-4">scroll()</a></code> method was invoked with <var>options</var> as the only argument.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="attribute" data-export="" data-lt="scrollTop" id="dom-element-scrolltop">scrollTop<span class="dfn-panel" data-deco=""><b><a href="#dom-element-scrolltop">#dom-element-scrolltop</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-scrolltop-1">5. Extensions to the Document Interface</a></span><span><a href="#ref-for-dom-element-scrolltop-2">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-element-scrolltop-3">(2)</a> <a href="#ref-for-dom-element-scrolltop-4">(3)</a> <a href="#ref-for-dom-element-scrolltop-5">(4)</a></span><span><a href="#ref-for-dom-element-scrolltop-6">Changes From 17 December 2013</a></span></span></dfn> attribute, on getting, must return the result of running these steps:</p> <ol> <li data-md=""> <p>Let <var>document</var> be the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>.</p> <li data-md=""> <p>If <var>document</var> is not the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">active document</a>, return zero and terminate these steps.</p> <li data-md=""> <p>Let <var>window</var> be the value of <var>document</var>’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#dom-document-defaultview">defaultView</a></code> attribute.</p> <li data-md=""> <p>If <var>window</var> is null, return zero and terminate these steps.</p> <li data-md=""> <p>If the element is the root element and <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, return zero and terminate these steps.</p> <li data-md=""> <p>If the element is the root element return the value of <code class="idl"><a data-link-type="idl" href="#dom-window-scrolly" id="ref-for-dom-window-scrolly-4">scrollY</a></code> on <var>window</var>.</p> <li data-md=""> <p>If the element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-7">the HTML <code>body</code> element</a>, <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, and the element is not <a data-link-type="dfn" href="#potentially-scrollable" id="ref-for-potentially-scrollable-4">potentially scrollable</a>, return the value of <code class="idl"><a data-link-type="idl" href="#dom-window-scrolly" id="ref-for-dom-window-scrolly-5">scrollY</a></code> on <var>window</var>.</p> <li data-md=""> <p>If the element does not have any associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-6">CSS layout box</a>, return zero and terminate these steps.</p> <li data-md=""> <p>Return the y-coordinate of the <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-10">scrolling area</a> at the alignment point with the top of the <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-17">padding edge</a> of the element.</p> </ol> <p>When setting the <code class="idl"><a data-link-type="idl" href="#dom-element-scrolltop" id="ref-for-dom-element-scrolltop-4">scrollTop</a></code> attribute these steps must be run:</p> <ol> <li data-md=""> <p>Let <var>y</var> be the given value.</p> <li data-md=""> <p><a data-link-type="dfn" href="#normalize-non-finite-values" id="ref-for-normalize-non-finite-values-7">Normalize non-finite values</a> for <var>y</var>.</p> <li data-md=""> <p>Let <var>document</var> be the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>.</p> <li data-md=""> <p>If <var>document</var> is not the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">active document</a>, terminate these steps.</p> <li data-md=""> <p>Let <var>window</var> be the value of <var>document</var>’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#dom-document-defaultview">defaultView</a></code> attribute.</p> <li data-md=""> <p>If <var>window</var> is null, terminate these steps.</p> <li data-md=""> <p>If the element is the root element and <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, terminate these steps.</p> <li data-md=""> <p>If the element is the root element invoke <code class="idl"><a data-link-type="idl" href="#dom-window-scroll" id="ref-for-dom-window-scroll-7">scroll()</a></code> on <var>window</var> with <code class="idl"><a data-link-type="idl" href="#dom-window-scrollx" id="ref-for-dom-window-scrollx-5">scrollX</a></code> on <var>window</var> as first argument and <var>y</var> as second argument, and terminate these steps.</p> <li data-md=""> <p>If the element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-8">the HTML <code>body</code> element</a>, <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, and the element is not <a data-link-type="dfn" href="#potentially-scrollable" id="ref-for-potentially-scrollable-5">potentially scrollable</a>, invoke <code class="idl"><a data-link-type="idl" href="#dom-window-scroll" id="ref-for-dom-window-scroll-8">scroll()</a></code> on <var>window</var> with <code class="idl"><a data-link-type="idl" href="#dom-window-scrollx" id="ref-for-dom-window-scrollx-6">scrollX</a></code> as first argument and <var>y</var> as second argument, and terminate these steps.</p> <li data-md=""> <p>If the element does not have any associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-7">CSS layout box</a>, the element has no associated <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-8">scrolling box</a>, or the element has no overflow, terminate these steps.</p> <li data-md=""> <p><a data-link-type="dfn" href="#scroll-an-element" id="ref-for-scroll-an-element-2">Scroll the element</a> to <code class="idl"><a data-link-type="idl" href="#dom-element-scrollleft" id="ref-for-dom-element-scrollleft-4">scrollLeft</a></code>,<var>y</var>, with the scroll behavior being <code>"auto"</code>.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="attribute" data-export="" data-lt="scrollLeft" id="dom-element-scrollleft">scrollLeft<span class="dfn-panel" data-deco=""><b><a href="#dom-element-scrollleft">#dom-element-scrollleft</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-scrollleft-1">5. Extensions to the Document Interface</a></span><span><a href="#ref-for-dom-element-scrollleft-2">6. Extensions to the Element Interface</a> <a href="#ref-for-dom-element-scrollleft-3">(2)</a> <a href="#ref-for-dom-element-scrollleft-4">(3)</a> <a href="#ref-for-dom-element-scrollleft-5">(4)</a></span><span><a href="#ref-for-dom-element-scrollleft-6">Changes From 17 December 2013</a> <a href="#ref-for-dom-element-scrollleft-7">(2)</a></span></span></dfn> attribute, on getting, must return the result of running these steps:</p> <ol> <li data-md=""> <p>Let <var>document</var> be the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>.</p> <li data-md=""> <p>If <var>document</var> is not the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">active document</a>, return zero and terminate these steps.</p> <li data-md=""> <p>Let <var>window</var> be the value of <var>document</var>’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#dom-document-defaultview">defaultView</a></code> attribute.</p> <li data-md=""> <p>If <var>window</var> is null, return zero and terminate these steps.</p> <li data-md=""> <p>If the element is the root element and <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, return zero and terminate these steps.</p> <li data-md=""> <p>If the element is the root element return the value of <code class="idl"><a data-link-type="idl" href="#dom-window-scrollx" id="ref-for-dom-window-scrollx-7">scrollX</a></code> on <var>window</var>.</p> <li data-md=""> <p>If the element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-9">the HTML <code>body</code> element</a>, <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, and the element is not <a data-link-type="dfn" href="#potentially-scrollable" id="ref-for-potentially-scrollable-6">potentially scrollable</a>, return the value of <code class="idl"><a data-link-type="idl" href="#dom-window-scrollx" id="ref-for-dom-window-scrollx-8">scrollX</a></code> on <var>window</var>.</p> <li data-md=""> <p>If the element does not have any associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-8">CSS layout box</a>, return zero and terminate these steps.</p> <li data-md=""> <p>Return the x-coordinate of the <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-11">scrolling area</a> at the alignment point with the left of the <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-18">padding edge</a> of the element.</p> </ol> <p>When setting the <code class="idl"><a data-link-type="idl" href="#dom-element-scrollleft" id="ref-for-dom-element-scrollleft-5">scrollLeft</a></code> attribute these steps must be run:</p> <ol> <li data-md=""> <p>Let <var>x</var> be the given value.</p> <li data-md=""> <p><a data-link-type="dfn" href="#normalize-non-finite-values" id="ref-for-normalize-non-finite-values-8">Normalize non-finite values</a> for <var>x</var>.</p> <li data-md=""> <p>Let <var>document</var> be the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>.</p> <li data-md=""> <p>If <var>document</var> is not the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">active document</a>, terminate these steps.</p> <li data-md=""> <p>Let <var>window</var> be the value of <var>document</var>’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#dom-document-defaultview">defaultView</a></code> attribute.</p> <li data-md=""> <p>If <var>window</var> is null, terminate these steps.</p> <li data-md=""> <p>If the element is the root element and <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, terminate these steps.</p> <li data-md=""> <p>If the element is the root element invoke <code class="idl"><a data-link-type="idl" href="#dom-window-scroll" id="ref-for-dom-window-scroll-9">scroll()</a></code> on <var>window</var> with <var>x</var> as first argument and <code class="idl"><a data-link-type="idl" href="#dom-window-scrolly" id="ref-for-dom-window-scrolly-6">scrollY</a></code> on <var>window</var> as second argument, and terminate these steps.</p> <li data-md=""> <p>If the element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-10">the HTML <code>body</code> element</a>, <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, and the element is not <a data-link-type="dfn" href="#potentially-scrollable" id="ref-for-potentially-scrollable-7">potentially scrollable</a>, invoke <code class="idl"><a data-link-type="idl" href="#dom-window-scroll" id="ref-for-dom-window-scroll-10">scroll()</a></code> on <var>window</var> with <var>x</var> as first argument and <code class="idl"><a data-link-type="idl" href="#dom-window-scrolly" id="ref-for-dom-window-scrolly-7">scrollY</a></code> on <var>window</var> as second argument, and terminate these steps.</p> <li data-md=""> <p>If the element does not have any associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-9">CSS layout box</a>, the element has no associated <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-9">scrolling box</a>, or the element has no overflow, terminate these steps.</p> <li data-md=""> <p><a data-link-type="dfn" href="#scroll-an-element" id="ref-for-scroll-an-element-3">Scroll the element</a> to <var>x</var>,<code class="idl"><a data-link-type="idl" href="#dom-element-scrolltop" id="ref-for-dom-element-scrolltop-5">scrollTop</a></code>, with the scroll behavior being <code>"auto"</code>.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="attribute" data-export="" data-lt="scrollWidth" id="dom-element-scrollwidth">scrollWidth<span class="dfn-panel" data-deco=""><b><a href="#dom-element-scrollwidth">#dom-element-scrollwidth</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-scrollwidth-1">6. Extensions to the Element Interface</a></span><span><a href="#ref-for-dom-element-scrollwidth-2">Changes From 17 December 2013</a></span></span></dfn> attribute must return the result of running these steps:</p> <ol> <li data-md=""> <p>Let <var>document</var> be the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>.</p> <li data-md=""> <p>If <var>document</var> is not the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">active document</a>, return zero and terminate these steps.</p> <li data-md=""> <p>Let <var>viewport width</var> be the width of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-65">viewport</a> excluding the width of the scroll bar, if any, or zero if there is no <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-66">viewport</a>.</p> <li data-md=""> <p>If the element is the root element and <var>document</var> is not in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a> return max(<a data-link-type="dfn" href="#viewport" id="ref-for-viewport-67">viewport</a> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-12">scrolling area</a> width, <var>viewport width</var>).</p> <li data-md=""> <p>If the element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-11">the HTML <code>body</code> element</a>, <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a> and the element is not <a data-link-type="dfn" href="#potentially-scrollable" id="ref-for-potentially-scrollable-8">potentially scrollable</a>, return max(<a data-link-type="dfn" href="#viewport" id="ref-for-viewport-68">viewport</a> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-13">scrolling area</a> width, <var>viewport width</var>).</p> <li data-md=""> <p>If the element does not have any associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-10">CSS layout box</a> return zero and terminate these steps.</p> <li data-md=""> <p>Return the width of the element’s <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-14">scrolling area</a>.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="attribute" data-export="" data-lt="scrollHeight" id="dom-element-scrollheight">scrollHeight<span class="dfn-panel" data-deco=""><b><a href="#dom-element-scrollheight">#dom-element-scrollheight</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-scrollheight-1">6. Extensions to the Element Interface</a></span><span><a href="#ref-for-dom-element-scrollheight-2">Changes From 17 December 2013</a></span></span></dfn> attribute must return the result of running these steps:</p> <ol> <li data-md=""> <p>Let <var>document</var> be the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>.</p> <li data-md=""> <p>If <var>document</var> is not the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">active document</a>, return zero and terminate these steps.</p> <li data-md=""> <p>Let <var>viewport height</var> be the height of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-69">viewport</a> excluding the height of the scroll bar, if any, or zero if there is no <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-70">viewport</a>.</p> <li data-md=""> <p>If the element is the root element and <var>document</var> is not in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a> return max(<a data-link-type="dfn" href="#viewport" id="ref-for-viewport-71">viewport</a> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-15">scrolling area</a> height, <var>viewport height</var>).</p> <li data-md=""> <p>If the element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-12">the HTML <code>body</code> element</a>, <var>document</var> is in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a> and the element is not <a data-link-type="dfn" href="#potentially-scrollable" id="ref-for-potentially-scrollable-9">potentially scrollable</a>, return max(<a data-link-type="dfn" href="#viewport" id="ref-for-viewport-72">viewport</a> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-16">scrolling area</a> height, <var>viewport height</var>).</p> <li data-md=""> <p>If the element does not have any associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-11">CSS layout box</a> return zero and terminate these steps.</p> <li data-md=""> <p>Return the height of the element’s <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-17">scrolling area</a>.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="attribute" data-export="" data-lt="clientTop" id="dom-element-clienttop">clientTop<span class="dfn-panel" data-deco=""><b><a href="#dom-element-clienttop">#dom-element-clienttop</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-clienttop-1">6. Extensions to the Element Interface</a></span><span><a href="#ref-for-dom-element-clienttop-2">Changes From 17 December 2013</a></span></span></dfn> attribute must run these steps:</p> <ol> <li data-md=""> <p>If the element has no associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-12">CSS layout box</a> or if the <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-13">CSS layout box</a> is inline, return zero.</p> <li data-md=""> <p>Return the computed value of the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/css3-background/#border-top-width">border-top-width</a> property plus the height of any scrollbar rendered between the top <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-19">padding edge</a> and the top <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-1">border edge</a>, ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-9">transforms</a> that apply to the element and its ancestors.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="attribute" data-export="" data-lt="clientLeft" id="dom-element-clientleft">clientLeft<span class="dfn-panel" data-deco=""><b><a href="#dom-element-clientleft">#dom-element-clientleft</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-clientleft-1">6. Extensions to the Element Interface</a></span><span><a href="#ref-for-dom-element-clientleft-2">Changes From 17 December 2013</a></span></span></dfn> attribute must run these steps:</p> <ol> <li data-md=""> <p>If the element has no associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-14">CSS layout box</a> or if the <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-15">CSS layout box</a> is inline, return zero.</p> <li data-md=""> <p>Return the computed value of the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/css3-background/#border-left-width">border-left-width</a> property plus the width of any scrollbar rendered between the left <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-20">padding edge</a> and the left <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-2">border edge</a>, ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-10">transforms</a> that apply to the element and its ancestors.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="attribute" data-export="" data-lt="clientWidth" id="dom-element-clientwidth">clientWidth<span class="dfn-panel" data-deco=""><b><a href="#dom-element-clientwidth">#dom-element-clientwidth</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-clientwidth-1">6. Extensions to the Element Interface</a></span><span><a href="#ref-for-dom-element-clientwidth-2">Changes From 17 December 2013</a></span></span></dfn> attribute must run these steps:</p> <ol> <li data-md=""> <p>If the element has no associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-16">CSS layout box</a> or if the <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-17">CSS layout box</a> is inline, return zero.</p> <li data-md=""> <p>If the element is the root element and the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a> is not in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, or if the element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-13">the HTML <code>body</code> element</a> and the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a> <em>is</em> in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, return the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-73">viewport</a> width excluding the size of a rendered scroll bar (if any).</p> <li data-md=""> <p>Return the width of the <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-21">padding edge</a> excluding the width of any rendered scrollbar between the <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-22">padding edge</a> and the <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-3">border edge</a>, ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-11">transforms</a> that apply to the element and its ancestors.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Element" data-dfn-type="attribute" data-export="" data-lt="clientHeight" id="dom-element-clientheight">clientHeight<span class="dfn-panel" data-deco=""><b><a href="#dom-element-clientheight">#dom-element-clientheight</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-element-clientheight-1">6. Extensions to the Element Interface</a></span><span><a href="#ref-for-dom-element-clientheight-2">Changes From 17 December 2013</a></span></span></dfn> attribute must run these steps:</p> <ol> <li data-md=""> <p>If the element has no associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-18">CSS layout box</a> or if the <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-19">CSS layout box</a> is inline, return zero.</p> <li data-md=""> <p>If the element is the root element and the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a> is not in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, or if the element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-14">the HTML <code>body</code> element</a> and the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a> <em>is</em> in <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</a>, return the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-74">viewport</a> height excluding the size of a rendered scroll bar (if any).</p> <li data-md=""> <p>Return the height of the <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-23">padding edge</a> excluding the height of any rendered scrollbar between the <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-24">padding edge</a> and the <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-4">border edge</a>, ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-12">transforms</a> that apply to the element and its ancestors.</p> </ol> <h3 class="heading settled" data-level="6.1" id="element-scrolling-members"><span class="secno">6.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element">Element</a></code> Scrolling Members</span><a class="self-link" href="#element-scrolling-members"></a></h3> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="scroll an element into view" data-noexport="" id="scroll-an-element-into-view">scroll an element into view<span class="dfn-panel" data-deco=""><b><a href="#scroll-an-element-into-view">#scroll-an-element-into-view</a></b><b>Referenced in:</b><span><a href="#ref-for-scroll-an-element-into-view-1">6. Extensions to the Element Interface</a></span></span></dfn> <var>element</var>, with a <code class="idl"><a data-link-type="idl" href="#dictdef-scrollintoviewoptions" id="ref-for-dictdef-scrollintoviewoptions-2">ScrollIntoViewOptions</a></code> dictionary <var>options</var>, means to run these steps for each ancestor element or <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-75">viewport</a> that establishes a <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-10">scrolling box</a> <var>scrolling box</var>, in order of innermost to outermost <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-11">scrolling box</a>:</p> <ol> <li data-md=""> <p>If the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> associated with <var>element</var> is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#same-origin">same origin</a> with the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> associated with the element or <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-76">viewport</a> associated with <var>box</var>, terminate these steps.</p> <li data-md=""> <p>Let <var>element bounding border box</var> be the box that the return value of invoking <code class="idl"><a data-link-type="idl" href="#dom-element-getboundingclientrect" id="ref-for-dom-element-getboundingclientrect-2">getBoundingClientRect()</a></code> on <var>element</var> represents.</p> <li data-md=""> <p>Let <var>scrolling box edge A</var> be the <a data-link-type="dfn" href="#beginning-edges" id="ref-for-beginning-edges-3">beginning edge</a> in the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> of <var>scrolling box</var>, and let <var>element edge A</var> be <var>element bounding border box</var>’s edge on the same physical side as that of <var>scrolling box edge A</var>.</p> <li data-md=""> <p>Let <var>scrolling box edge B</var> be the <a data-link-type="dfn" href="#ending-edges" id="ref-for-ending-edges-1">ending edge</a> in the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> of <var>scrolling box</var>, and let <var>element edge B</var> be <var>element bounding border box</var>’s edge on the same physical side as that of <var>scrolling box edge B</var>.</p> <li data-md=""> <p>Let <var>scrolling box edge C</var> be the <a data-link-type="dfn" href="#beginning-edges" id="ref-for-beginning-edges-4">beginning edge</a> in the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a> of <var>scrolling box</var>, and let <var>element edge C</var> be <var>element bounding border box</var>’s edge on the same physical side as that of <var>scrolling box edge C</var>.</p> <li data-md=""> <p>Let <var>scrolling box edge D</var> be the <a data-link-type="dfn" href="#ending-edges" id="ref-for-ending-edges-2">ending edge</a> in the <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a> of <var>scrolling box</var>, and let <var>element edge D</var> be <var>element bounding border box</var>’s edge on the same physical side as that of <var>scrolling box edge D</var>.</p> <li data-md=""> <p>Let <var>element width</var> be the distance between <var>element edge C</var> and <var>element edge D</var>.</p> <li data-md=""> <p>Let <var>scrolling box width</var> be the distance between <var>scrolling box edge C</var> and <var>scrolling box edge D</var>.</p> <li data-md=""> <p>Let <var>position</var> be the scroll position <var>scrolling box</var> would have by following these steps:</p> <ol> <li data-md=""> <p>If the <code class="idl"><a data-link-type="idl" href="#dom-scrollintoviewoptions-block" id="ref-for-dom-scrollintoviewoptions-block-3">block</a></code> dictionary member of <var>options</var> is "start", align <var>element edge A</var> with <var>scrolling box edge A</var>.</p> <li data-md=""> <p>Otherwise, if the <code class="idl"><a data-link-type="idl" href="#dom-scrollintoviewoptions-block" id="ref-for-dom-scrollintoviewoptions-block-4">block</a></code> dictionary member of <var>options</var> is "end"; align <var>element edge B</var> with <var>scrolling box edge B</var>.</p> <li data-md=""> <p>Otherwise, if the <code class="idl"><a data-link-type="idl" href="#dom-scrollintoviewoptions-block" id="ref-for-dom-scrollintoviewoptions-block-5">block</a></code> dictionary member of <var>options</var> is "center"; align the center of <var>element bounding border box</var> with the center of <var>scrolling box</var> in <var>scrolling box</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a>.</p> <li data-md=""> <p>Otherwise, it is "nearest"; follow these steps:</p> <dl class="switch"> <dt>If <var>element edge A</var> and <var>element edge B</var> are both outside <var>scrolling box edge A</var> and <var>scrolling box edge B</var> <dd>Do nothing. <dt>If <var>element edge A</var> is outside <var>scrolling box edge A</var> and <var>element width</var> is less than <var>scrolling box width</var> <dt>If <var>element edge B</var> is outside <var>scrolling box edge B</var> and <var>element width</var> is greater than <var>scrolling box width</var> <dd>Align <var>element edge A</var> with <var>scrolling box edge A</var>. <dt>If <var>element edge A</var> is outside <var>scrolling box edge A</var> and <var>element width</var> is greater than <var>scrolling box width</var> <dt>If <var>element edge B</var> is outside <var>scrolling box edge B</var> and <var>element width</var> is less than <var>scrolling box width</var> <dd>Align <var>element edge B</var> with <var>scrolling box edge B</var>. </dl> <li data-md=""> <p>If the <code class="idl"><a data-link-type="idl" href="#dom-scrollintoviewoptions-inline" id="ref-for-dom-scrollintoviewoptions-inline-3">inline</a></code> dictionary member of <var>options</var> is "start", align <var>element edge C</var> with <var>scrolling box edge C</var>.</p> <li data-md=""> <p>Otherwise, if the <code class="idl"><a data-link-type="idl" href="#dom-scrollintoviewoptions-inline" id="ref-for-dom-scrollintoviewoptions-inline-4">inline</a></code> dictionary member of <var>options</var> is "end"; align <var>element edge D</var> with <var>scrolling box edge D</var>.</p> <li data-md=""> <p>Otherwise, if the <code class="idl"><a data-link-type="idl" href="#dom-scrollintoviewoptions-inline" id="ref-for-dom-scrollintoviewoptions-inline-5">inline</a></code> dictionary member of <var>options</var> is "center", align the center of <var>element bounding border box</var> with the center of <var>scrolling box</var> in <var>scrolling box</var>’s <a data-link-type="dfn" href="https://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a>.</p> <li data-md=""> <p>Otherwise, it is "nearest"; follow these steps:</p> <dl class="switch"> <dt>If <var>element edge C</var> and <var>element edge D</var> are both outside <var>scrolling box edge C</var> and <var>scrolling box edge D</var> <dd>Do nothing. <dt>If <var>element edge C</var> is outside <var>scrolling box edge C</var> and <var>element width</var> is less than <var>scrolling box width</var> <dt>If <var>element edge D</var> is outside <var>scrolling box edge D</var> and <var>element width</var> is greater than <var>scrolling box width</var> <dd>Align <var>element edge C</var> with <var>scrolling box edge C</var>. <dt>If <var>element edge C</var> is outside <var>scrolling box edge C</var> and <var>element width</var> is greater than <var>scrolling box width</var> <dt>If <var>element edge D</var> is outside <var>scrolling box edge D</var> and <var>element width</var> is less than <var>scrolling box width</var> <dd>Align <var>element edge D</var> with <var>scrolling box edge D</var>. </dl> </ol> <li data-md=""> <p>If <var>position</var> is the same as <var>scrolling box</var>’s current scroll position, and <var>scrolling box</var> does not have an ongoing <a data-link-type="dfn" href="#concept-smooth-scroll" id="ref-for-concept-smooth-scroll-5">smooth scroll</a>, abort these steps.</p> <li data-md=""> <dl class="switch"> <dt>If <var>scrolling box</var> is associated with an element <dd> Let <var>associated element</var> be the element. <dt>If <var>scrolling box</var> is associated with a <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-77">viewport</a> <dd> Let <var>document</var> be the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-78">viewport’s</a> associated <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code>. Let <var>associated element</var> be <var>document</var>’s root element, if there is one, or null otherwise. </dl> <li data-md=""> <p>Let <var>behavior</var> be the <code class="idl"><a data-link-type="idl" href="#dom-scrolloptions-behavior" id="ref-for-dom-scrolloptions-behavior-3">behavior</a></code> dictionary member of <var>options</var>.</p> <li data-md=""> <p><a data-link-type="dfn" href="#perform-a-scroll" id="ref-for-perform-a-scroll-3">Perform a scroll</a> of <var>scrolling box</var> to <var>position</var>, <var>associated element</var> as the associated element and <var>behavior</var> as the scroll behavior.</p> </ol> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="scroll an element" data-noexport="" id="scroll-an-element">scroll an element<span class="dfn-panel" data-deco=""><b><a href="#scroll-an-element">#scroll-an-element</a></b><b>Referenced in:</b><span><a href="#ref-for-scroll-an-element-1">6. Extensions to the Element Interface</a> <a href="#ref-for-scroll-an-element-2">(2)</a> <a href="#ref-for-scroll-an-element-3">(3)</a></span></span></dfn> <var>element</var> to <var>x</var>,<var>y</var> optionally with a scroll behavior <var>behavior</var> (which is <code>"auto"</code> if omitted) means to:</p> <ol> <li data-md=""> <p>Let <var>box</var> be <var>element</var>’s associated <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-12">scrolling box</a>.</p> <li data-md=""> <dl class="switch"> <dt>If <var>box</var> has rightward <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-15">overflow direction</a> <dd>Let <var>x</var> be max(0, min(<var>x</var>, <var>element</var> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-18">scrolling area</a> width - <var>element</var> <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-25">padding edge</a> width)). <dt>If <var>box</var> has leftward <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-16">overflow direction</a> <dd>Let <var>x</var> be min(0, max(<var>x</var>, <var>element</var> <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-26">padding edge</a> width - <var>element</var> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-19">scrolling area</a> width)). </dl> <li data-md=""> <dl class="switch"> <dt>If <var>box</var> has downward <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-17">overflow direction</a> <dd>Let <var>y</var> be max(0, min(<var>y</var>, <var>element</var> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-20">scrolling area</a> height - <var>element</var> <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-27">padding edge</a> height)). <dt>If <var>box</var> has upward <a data-link-type="dfn" href="#overflow-directions" id="ref-for-overflow-directions-18">overflow direction</a> <dd>Let <var>y</var> be min(0, max(<var>y</var>, <var>element</var> <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-28">padding edge</a> height - <var>element</var> <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-21">scrolling area</a> height)). </dl> <li data-md=""> <p>Let <var>position</var> be the scroll position <var>box</var> would have by aligning <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-22">scrolling area</a> x-coordinate <var>x</var> with the left of <var>box</var> and aligning <a data-link-type="dfn" href="#scrolling-area" id="ref-for-scrolling-area-23">scrolling area</a> y-coordinate <var>y</var> with the top of <var>box</var>.</p> <li data-md=""> <p>If <var>position</var> is the same as <var>box</var>’s current scroll position, and <var>box</var> does not have an ongoing <a data-link-type="dfn" href="#concept-smooth-scroll" id="ref-for-concept-smooth-scroll-6">smooth scroll</a>, abort these steps.</p> <li data-md=""> <p><a data-link-type="dfn" href="#perform-a-scroll" id="ref-for-perform-a-scroll-4">Perform a scroll</a> of <var>box</var> to <var>position</var>, <var>element</var> as the associated element and <var>behavior</var> as the scroll behavior.</p> </ol> <h2 class="heading settled" data-level="7" id="extensions-to-the-htmlelement-interface"><span class="secno">7. </span><span class="content">Extensions to the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#htmlelement">HTMLElement</a></code> Interface</span><a class="self-link" href="#extensions-to-the-htmlelement-interface"></a></h2> <pre class="idl def">partial interface <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/dom.html#htmlelement">HTMLElement</a> { readonly attribute <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Element? " href="#dom-htmlelement-offsetparent" id="ref-for-dom-htmlelement-offsetparent-1">offsetParent</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlelement-offsettop" id="ref-for-dom-htmlelement-offsettop-1">offsetTop</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlelement-offsetleft" id="ref-for-dom-htmlelement-offsetleft-1">offsetLeft</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlelement-offsetwidth" id="ref-for-dom-htmlelement-offsetwidth-1">offsetWidth</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlelement-offsetheight" id="ref-for-dom-htmlelement-offsetheight-1">offsetHeight</a>; }; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLElement" data-dfn-type="attribute" data-export="" data-lt="offsetParent" id="dom-htmlelement-offsetparent">offsetParent<span class="dfn-panel" data-deco=""><b><a href="#dom-htmlelement-offsetparent">#dom-htmlelement-offsetparent</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-htmlelement-offsetparent-1">7. Extensions to the HTMLElement Interface</a> <a href="#ref-for-dom-htmlelement-offsetparent-2">(2)</a> <a href="#ref-for-dom-htmlelement-offsetparent-3">(3)</a> <a href="#ref-for-dom-htmlelement-offsetparent-4">(4)</a> <a href="#ref-for-dom-htmlelement-offsetparent-5">(5)</a></span></span></dfn> attribute must return the result of running these steps:</p> <ol> <li data-md=""> <p>If any of the following holds true return null and terminate this algorithm:</p> <ul> <li data-md=""> <p>The element does not have an associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-20">CSS layout box</a>.</p> <li data-md=""> <p>The element is the root element.</p> <li data-md=""> <p>The element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-15">the HTML <code>body</code> element</a>.</p> <li data-md=""> <p>The element’s computed value of the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/css3-positioning/#propdef-position">position</a> property is <a class="css" data-link-type="maybe" href="https://www.w3.org/TR/css3-positioning/#valdef-position-positionfake-maybe-placeholderfixed-fake-maybe-placeholder">fixed</a>.</p> </ul> <li data-md=""> <p>Return the nearest ancestor element of the element for which at least one of the following is true and terminate this algorithm if such an ancestor is found:</p> <ul> <li data-md=""> <p>The computed value of the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/css3-positioning/#propdef-position">position</a> property is not <a class="css" data-link-type="maybe" href="https://www.w3.org/TR/css3-positioning/#valdef-position-positionfake-maybe-placeholderstatic-fake-maybe-placeholder">static</a>.</p> <li data-md=""> <p>It is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-16">the HTML <code>body</code> element</a>.</p> <li data-md=""> <p>The computed value of the <a class="property" data-link-type="propdesc" href="https://www.w3.org/TR/css3-positioning/#propdef-position">position</a> property of the element is <a class="css" data-link-type="maybe" href="https://www.w3.org/TR/css3-positioning/#valdef-position-positionfake-maybe-placeholderstatic-fake-maybe-placeholder">static</a> and the ancestor is one of the following <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#html-elements">HTML elements</a>: <code>td</code>, <code>th</code>, or <code>table</code>.</p> </ul> <li data-md=""> <p>Return null.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLElement" data-dfn-type="attribute" data-export="" data-lt="offsetTop" id="dom-htmlelement-offsettop">offsetTop<span class="dfn-panel" data-deco=""><b><a href="#dom-htmlelement-offsettop">#dom-htmlelement-offsettop</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-htmlelement-offsettop-1">7. Extensions to the HTMLElement Interface</a></span></span></dfn> attribute must return the result of running these steps:</p> <ol> <li data-md=""> <p>If the element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-17">the HTML <code>body</code> element</a> or does not have any associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-21">CSS layout box</a> return zero and terminate this algorithm.</p> <li data-md=""> <p>If the <code class="idl"><a data-link-type="idl" href="#dom-htmlelement-offsetparent" id="ref-for-dom-htmlelement-offsetparent-2">offsetParent</a></code> of the element is null return the y-coordinate of the top <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-5">border edge</a> of the first <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-22">CSS layout box</a> associated with the element, relative to the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> origin, ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-13">transforms</a> that apply to the element and its ancestors, and terminate this algorithm.</p> <li data-md=""> <p>Return the result of subtracting the y-coordinate of the top <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-29">padding edge</a> of the first <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-23">CSS layout box</a> associated with the <code class="idl"><a data-link-type="idl" href="#dom-htmlelement-offsetparent" id="ref-for-dom-htmlelement-offsetparent-3">offsetParent</a></code> of the element from the y-coordinate of the top <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-6">border edge</a> of the first <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-24">CSS layout box</a> associated with the element, relative to the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> origin, ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-14">transforms</a> that apply to the element and its ancestors.</p> <p class="note" role="note">Note: An inline element that consists of multiple line boxes will only have its first <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-25">CSS layout box</a> considered.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLElement" data-dfn-type="attribute" data-export="" data-lt="offsetLeft" id="dom-htmlelement-offsetleft">offsetLeft<span class="dfn-panel" data-deco=""><b><a href="#dom-htmlelement-offsetleft">#dom-htmlelement-offsetleft</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-htmlelement-offsetleft-1">7. Extensions to the HTMLElement Interface</a></span></span></dfn> attribute must return the result of running these steps:</p> <ol> <li data-md=""> <p>If the element is <a data-link-type="dfn" href="#the-html-body-element" id="ref-for-the-html-body-element-18">the HTML <code>body</code> element</a> or does not have any associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-26">CSS layout box</a> return zero and terminate this algorithm.</p> <li data-md=""> <p>If the <code class="idl"><a data-link-type="idl" href="#dom-htmlelement-offsetparent" id="ref-for-dom-htmlelement-offsetparent-4">offsetParent</a></code> of the element is null return the x-coordinate of the left <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-7">border edge</a> of the first <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-27">CSS layout box</a> associated with the element, relative to the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> origin, , ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-15">transforms</a> that apply to the element and its ancestors, and terminate this algorithm.</p> <li data-md=""> <p>Return the result of subtracting the x-coordinate of the left <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-30">padding edge</a> of the first <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-28">CSS layout box</a> associated with the <code class="idl"><a data-link-type="idl" href="#dom-htmlelement-offsetparent" id="ref-for-dom-htmlelement-offsetparent-5">offsetParent</a></code> of the element from the x-coordinate of the left <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-8">border edge</a> of the first <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-29">CSS layout box</a> associated with the element, relative to the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> origin, ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-16">transforms</a> that apply to the element and its ancestors.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLElement" data-dfn-type="attribute" data-export="" data-lt="offsetWidth" id="dom-htmlelement-offsetwidth">offsetWidth<span class="dfn-panel" data-deco=""><b><a href="#dom-htmlelement-offsetwidth">#dom-htmlelement-offsetwidth</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-htmlelement-offsetwidth-1">7. Extensions to the HTMLElement Interface</a></span></span></dfn> attribute must return the result of running these steps:</p> <ol> <li data-md=""> <p>If the element does not have any associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-30">CSS layout box</a> return zero and terminate this algorithm.</p> <li data-md=""> <p>Return the <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-9">border edge</a> width of the first <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-31">CSS layout box</a> associated with the element, ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-17">transforms</a> that apply to the element and its ancestors.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLElement" data-dfn-type="attribute" data-export="" data-lt="offsetHeight" id="dom-htmlelement-offsetheight">offsetHeight<span class="dfn-panel" data-deco=""><b><a href="#dom-htmlelement-offsetheight">#dom-htmlelement-offsetheight</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-htmlelement-offsetheight-1">7. Extensions to the HTMLElement Interface</a></span></span></dfn> attribute must return the result of running these steps:</p> <ol> <li data-md=""> <p>If the element does not have any associated <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-32">CSS layout box</a> return zero and terminate this algorithm.</p> <li data-md=""> <p>Return the <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-10">border edge</a> height of the first <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-33">CSS layout box</a> associated with the element, ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-18">transforms</a> that apply to the element and its ancestors.</p> </ol> <h2 class="heading settled" data-level="8" id="extensions-to-the-htmlimageelement-interface"><span class="secno">8. </span><span class="content">Extensions to the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/embedded-content.html#htmlimageelement">HTMLImageElement</a></code> Interface</span><a class="self-link" href="#extensions-to-the-htmlimageelement-interface"></a></h2> <pre class="idl def">partial interface <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/embedded-content.html#htmlimageelement">HTMLImageElement</a> { readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlimageelement-x" id="ref-for-dom-htmlimageelement-x-1">x</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlimageelement-y" id="ref-for-dom-htmlimageelement-y-1">y</a>; }; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLImageElement" data-dfn-type="attribute" data-export="" data-lt="x" id="dom-htmlimageelement-x">x<span class="dfn-panel" data-deco=""><b><a href="#dom-htmlimageelement-x">#dom-htmlimageelement-x</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-htmlimageelement-x-1">8. Extensions to the HTMLImageElement Interface</a></span></span></dfn> attribute, on getting, must return the x-coordinate of the left <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-11">border edge</a> of the first <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-34">CSS layout box</a> associated with the element, relative to the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> origin, ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-19">transforms</a> that apply to the element and its ancestors, or zero if there is no <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-35">CSS layout box</a>.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="HTMLImageElement" data-dfn-type="attribute" data-export="" data-lt="y" id="dom-htmlimageelement-y">y<span class="dfn-panel" data-deco=""><b><a href="#dom-htmlimageelement-y">#dom-htmlimageelement-y</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-htmlimageelement-y-1">8. Extensions to the HTMLImageElement Interface</a></span></span></dfn> attribute, on getting, must return the y-coordinate of the top <a data-link-type="dfn" href="#border-edge" id="ref-for-border-edge-12">border edge</a> of the first <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-36">CSS layout box</a> associated with the element, relative to the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> origin, ignoring any <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-20">transforms</a> that apply to the element and its ancestors, or zero if there is no <a data-link-type="dfn" href="#css-layout-box" id="ref-for-css-layout-box-37">CSS layout box</a>.</p> <h2 class="heading settled" data-level="9" id="extensions-to-the-range-interface"><span class="secno">9. </span><span class="content">Extensions to the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#range">Range</a></code> Interface</span><a class="self-link" href="#extensions-to-the-range-interface"></a></h2> <p>The objects the methods described below return must be static.</p> <pre class="idl def">partial interface <a class="idl-code" data-link-type="interface" href="https://dom.spec.whatwg.org/#range">Range</a> { sequence<<a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a>> <a class="idl-code" data-link-type="method" href="#dom-range-getclientrects" id="ref-for-dom-range-getclientrects-2">getClientRects</a>(); [NewObject] <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a> <a class="idl-code" data-link-type="method" href="#dom-range-getboundingclientrect" id="ref-for-dom-range-getboundingclientrect-1">getBoundingClientRect</a>(); }; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" data-lt="getClientRects()" id="dom-range-getclientrects">getClientRects()<span class="dfn-panel" data-deco=""><b><a href="#dom-range-getclientrects">#dom-range-getclientrects</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-range-getclientrects-1">5.1. The CaretPosition Interface</a></span><span><a href="#ref-for-dom-range-getclientrects-2">9. Extensions to the Range Interface</a> <a href="#ref-for-dom-range-getclientrects-3">(2)</a></span></span></dfn> method, when invoked, must return an empty sequence if the range is not in the document and otherwise a sequence object containing static <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> objects in content order that matches the following constraints:</p> <ul> <li data-md=""> <p>For each element selected by the range, whose parent is not selected by the range, include the border areas returned by invoking <code class="idl"><a data-link-type="idl" href="#dom-element-getclientrects" id="ref-for-dom-element-getclientrects-3">getClientRects()</a></code> on the element.</p> <li data-md=""> <p>For each <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#text">Text</a></code> node selected or partially selected by the range (including when the boundary-points are identical), include a <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> object (for the part that is selected, not the whole line box). The bounds of these <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> objects are computed using font metrics; thus, for horizontal writing, the vertical dimension of each box is determined by the font ascent and descent, and the horizontal dimension by the text advance width. The <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-21">transforms</a> that apply to the ancestors are applied.</p> </ul> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" data-lt="getBoundingClientRect()" id="dom-range-getboundingclientrect">getBoundingClientRect()<span class="dfn-panel" data-deco=""><b><a href="#dom-range-getboundingclientrect">#dom-range-getboundingclientrect</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-range-getboundingclientrect-1">9. Extensions to the Range Interface</a></span></span></dfn> method, when invoked, must return the result of the following algorithm:</p> <ol> <li data-md=""> <p>Let <var>list</var> be the result of invoking <code class="idl"><a data-link-type="idl" href="#dom-range-getclientrects" id="ref-for-dom-range-getclientrects-3">getClientRects()</a></code> on the same range this method was invoked on.</p> <li data-md=""> <p>If <var>list</var> is empty return a static <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> object whose <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-domrect-x">x</a></code>, <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-domrect-y">y</a></code>, <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-domrect-width">width</a></code> and <code class="idl"><a data-link-type="idl" href="https://drafts.fxtf.org/geometry-1/#dom-domrect-height">height</a></code> members are zero.</p> <li data-md=""> <p>Otherwise, return a static <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> object describing the smallest rectangle that includes the first rectangle in <var>list</var> and all of the remaining rectangles of which the height or width is not zero.</p> </ol> <h2 class="heading settled" data-level="10" id="extensions-to-the-mouseevent-interface"><span class="secno">10. </span><span class="content">Extensions to the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/DOM-Level-3-Events/#interface-MouseEvent">MouseEvent</a></code> Interface</span><a class="self-link" href="#extensions-to-the-mouseevent-interface"></a></h2> <p class="issue" id="issue-6025106e"><a class="self-link" href="#issue-6025106e"></a> The object IDL fragment redefines some members. Can we resolve this somehow?</p> <pre class="idl def">partial interface <a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/DOM-Level-3-Events/#interface-MouseEvent">MouseEvent</a> { readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-screenx" id="ref-for-dom-mouseevent-screenx-1">screenX</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-screeny" id="ref-for-dom-mouseevent-screeny-1">screenY</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-pagex" id="ref-for-dom-mouseevent-pagex-1">pageX</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-pagey" id="ref-for-dom-mouseevent-pagey-1">pageY</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-clientx" id="ref-for-dom-mouseevent-clientx-1">clientX</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-clienty" id="ref-for-dom-mouseevent-clienty-1">clientY</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-x" id="ref-for-dom-mouseevent-x-1">x</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-y" id="ref-for-dom-mouseevent-y-1">y</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-offsetx" id="ref-for-dom-mouseevent-offsetx-1">offsetX</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-offsety" id="ref-for-dom-mouseevent-offsety-1">offsetY</a>; }; partial dictionary <dfn class="idl-code" data-dfn-type="dictionary" data-export="" id="dictdef-mouseeventinit">MouseEventInit<a class="self-link" href="#dictdef-mouseeventinit"></a></dfn> { double <dfn class="idl-code" data-default="0.0" data-dfn-for="MouseEventInit" data-dfn-type="dict-member" data-export="" data-type="double " id="dom-mouseeventinit-screenx">screenX<a class="self-link" href="#dom-mouseeventinit-screenx"></a></dfn> = 0.0; double <dfn class="idl-code" data-default="0.0" data-dfn-for="MouseEventInit" data-dfn-type="dict-member" data-export="" data-type="double " id="dom-mouseeventinit-screeny">screenY<a class="self-link" href="#dom-mouseeventinit-screeny"></a></dfn> = 0.0; double <dfn class="idl-code" data-default="0.0" data-dfn-for="MouseEventInit" data-dfn-type="dict-member" data-export="" data-type="double " id="dom-mouseeventinit-clientx">clientX<a class="self-link" href="#dom-mouseeventinit-clientx"></a></dfn> = 0.0; double <dfn class="idl-code" data-default="0.0" data-dfn-for="MouseEventInit" data-dfn-type="dict-member" data-export="" data-type="double " id="dom-mouseeventinit-clienty">clientY<a class="self-link" href="#dom-mouseeventinit-clienty"></a></dfn> = 0.0; }; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MouseEvent" data-dfn-type="attribute" data-export="" data-lt="screenX" id="dom-mouseevent-screenx">screenX<span class="dfn-panel" data-deco=""><b><a href="#dom-mouseevent-screenx">#dom-mouseevent-screenx</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mouseevent-screenx-1">10. Extensions to the MouseEvent Interface</a></span></span></dfn> attribute must return the x-coordinate of the position where the event occurred relative to the origin of the screen.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MouseEvent" data-dfn-type="attribute" data-export="" data-lt="screenY" id="dom-mouseevent-screeny">screenY<span class="dfn-panel" data-deco=""><b><a href="#dom-mouseevent-screeny">#dom-mouseevent-screeny</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mouseevent-screeny-1">10. Extensions to the MouseEvent Interface</a></span></span></dfn> attribute must return the y-coordinate of the position where the event occurred relative to the origin of the screen.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MouseEvent" data-dfn-type="attribute" data-export="" data-lt="pageX" id="dom-mouseevent-pagex">pageX<span class="dfn-panel" data-deco=""><b><a href="#dom-mouseevent-pagex">#dom-mouseevent-pagex</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mouseevent-pagex-1">10. Extensions to the MouseEvent Interface</a> <a href="#ref-for-dom-mouseevent-pagex-2">(2)</a></span></span></dfn> attribute must follow these steps:</p> <ol> <li data-md=""> <p>If the event’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#dispatch-flag">dispatch flag</a> is set, return the horizontal coordinate of the position where the event occurred relative to the origin of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> and terminate these steps.</p> <li data-md=""> <p>Let <var>offset</var> be the value of the <code class="idl"><a data-link-type="idl" href="#dom-window-scrollx" id="ref-for-dom-window-scrollx-9">scrollX</a></code> attribute of the event’s associated <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a></code> object, if there is one, or zero otherwise.</p> <li data-md=""> <p>Return the sum of <var>offset</var> and the value of the event’s <code class="idl"><a data-link-type="idl" href="#dom-mouseevent-clientx" id="ref-for-dom-mouseevent-clientx-2">clientX</a></code> attribute.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MouseEvent" data-dfn-type="attribute" data-export="" data-lt="pageY" id="dom-mouseevent-pagey">pageY<span class="dfn-panel" data-deco=""><b><a href="#dom-mouseevent-pagey">#dom-mouseevent-pagey</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mouseevent-pagey-1">10. Extensions to the MouseEvent Interface</a> <a href="#ref-for-dom-mouseevent-pagey-2">(2)</a></span></span></dfn> attribute must follow these steps:</p> <ol> <li data-md=""> <p>If the event’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#dispatch-flag">dispatch flag</a> is set, return the vertical coordinate of the position where the event occurred relative to the origin of the <a data-link-type="dfn" href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> and terminate these steps.</p> <li data-md=""> <p>Let <var>offset</var> be the value of the <code class="idl"><a data-link-type="idl" href="#dom-window-scrolly" id="ref-for-dom-window-scrolly-8">scrollY</a></code> attribute of the event’s associated <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a></code> object, if there is one, or zero otherwise.</p> <li data-md=""> <p>Return the sum of <var>offset</var> and the value of the event’s <code class="idl"><a data-link-type="idl" href="#dom-mouseevent-clienty" id="ref-for-dom-mouseevent-clienty-2">clientY</a></code> attribute.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MouseEvent" data-dfn-type="attribute" data-export="" data-lt="clientX" id="dom-mouseevent-clientx">clientX<span class="dfn-panel" data-deco=""><b><a href="#dom-mouseevent-clientx">#dom-mouseevent-clientx</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mouseevent-clientx-1">10. Extensions to the MouseEvent Interface</a> <a href="#ref-for-dom-mouseevent-clientx-2">(2)</a> <a href="#ref-for-dom-mouseevent-clientx-3">(3)</a></span></span></dfn> attribute must return the x-coordinate of the position where the event occurred relative to the origin of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-79">viewport</a>.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MouseEvent" data-dfn-type="attribute" data-export="" data-lt="clientY" id="dom-mouseevent-clienty">clientY<span class="dfn-panel" data-deco=""><b><a href="#dom-mouseevent-clienty">#dom-mouseevent-clienty</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mouseevent-clienty-1">10. Extensions to the MouseEvent Interface</a> <a href="#ref-for-dom-mouseevent-clienty-2">(2)</a> <a href="#ref-for-dom-mouseevent-clienty-3">(3)</a></span></span></dfn> attribute must return the y-coordinate of the position where the event occurred relative to the origin of the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-80">viewport</a>.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MouseEvent" data-dfn-type="attribute" data-export="" data-lt="x" id="dom-mouseevent-x">x<span class="dfn-panel" data-deco=""><b><a href="#dom-mouseevent-x">#dom-mouseevent-x</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mouseevent-x-1">10. Extensions to the MouseEvent Interface</a></span></span></dfn> attribute must return the value of <code class="idl"><a data-link-type="idl" href="#dom-mouseevent-clientx" id="ref-for-dom-mouseevent-clientx-3">clientX</a></code>.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MouseEvent" data-dfn-type="attribute" data-export="" data-lt="y" id="dom-mouseevent-y">y<span class="dfn-panel" data-deco=""><b><a href="#dom-mouseevent-y">#dom-mouseevent-y</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mouseevent-y-1">10. Extensions to the MouseEvent Interface</a></span></span></dfn> attribute must return the value of <code class="idl"><a data-link-type="idl" href="#dom-mouseevent-clienty" id="ref-for-dom-mouseevent-clienty-3">clientY</a></code>.</p> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MouseEvent" data-dfn-type="attribute" data-export="" data-lt="offsetX" id="dom-mouseevent-offsetx">offsetX<span class="dfn-panel" data-deco=""><b><a href="#dom-mouseevent-offsetx">#dom-mouseevent-offsetx</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mouseevent-offsetx-1">10. Extensions to the MouseEvent Interface</a></span></span></dfn> attribute must follow these steps:</p> <ol> <li data-md=""> <p>If the event’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#dispatch-flag">dispatch flag</a> is set, return the x-coordinate of the position where the event occurred relative to the origin of the <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-31">padding edge</a> of the target node, ignoring the <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-22">transforms</a> that apply to the element and its ancestors, and terminate these steps.</p> <li data-md=""> <p>Return the value of the event’s <code class="idl"><a data-link-type="idl" href="#dom-mouseevent-pagex" id="ref-for-dom-mouseevent-pagex-2">pageX</a></code> attribute.</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="MouseEvent" data-dfn-type="attribute" data-export="" data-lt="offsetY" id="dom-mouseevent-offsety">offsetY<span class="dfn-panel" data-deco=""><b><a href="#dom-mouseevent-offsety">#dom-mouseevent-offsety</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-mouseevent-offsety-1">10. Extensions to the MouseEvent Interface</a></span></span></dfn> attribute must follow these steps:</p> <ol> <li data-md=""> <p>If the event’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#dispatch-flag">dispatch flag</a> is set, return the y-coordinate of the position where the event occurred relative to the origin of the <a data-link-type="dfn" href="#padding-edge" id="ref-for-padding-edge-32">padding edge</a> of the target node, ignoring the <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-23">transforms</a> that apply to the element and its ancestors, and terminate these steps.</p> <li data-md=""> <p>Return the value of the event’s <code class="idl"><a data-link-type="idl" href="#dom-mouseevent-pagey" id="ref-for-dom-mouseevent-pagey-2">pageY</a></code> attribute.</p> </ol> <h2 class="heading settled" data-level="11" id="geometry"><span class="secno">11. </span><span class="content">Geometry</span><a class="self-link" href="#geometry"></a></h2> <h3 class="atrisk heading settled" data-level="11.1" id="the-geometryutils-interface"><span class="secno">11.1. </span><span class="content">The <code class="idl"><a data-link-type="idl" href="#geometryutils" id="ref-for-geometryutils-1">GeometryUtils</a></code> Interface</span><a class="self-link" href="#the-geometryutils-interface"></a></h3> <pre class="idl def">enum <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export="" data-lt="CSSBoxType" id="enumdef-cssboxtype">CSSBoxType<span class="dfn-panel" data-deco=""><b><a href="#enumdef-cssboxtype">#enumdef-cssboxtype</a></b><b>Referenced in:</b><span><a href="#ref-for-enumdef-cssboxtype-1">11.1. The GeometryUtils Interface</a> <a href="#ref-for-enumdef-cssboxtype-2">(2)</a> <a href="#ref-for-enumdef-cssboxtype-3">(3)</a></span></span></dfn> { <dfn class="idl-code" data-dfn-for="CSSBoxType" data-dfn-type="enum-value" data-export="" id="dom-cssboxtype-margin">"margin"<a class="self-link" href="#dom-cssboxtype-margin"></a></dfn>, <dfn class="idl-code" data-dfn-for="CSSBoxType" data-dfn-type="enum-value" data-export="" id="dom-cssboxtype-border">"border"<a class="self-link" href="#dom-cssboxtype-border"></a></dfn>, <dfn class="idl-code" data-dfn-for="CSSBoxType" data-dfn-type="enum-value" data-export="" id="dom-cssboxtype-padding">"padding"<a class="self-link" href="#dom-cssboxtype-padding"></a></dfn>, <dfn class="idl-code" data-dfn-for="CSSBoxType" data-dfn-type="enum-value" data-export="" id="dom-cssboxtype-content">"content"<a class="self-link" href="#dom-cssboxtype-content"></a></dfn> }; dictionary <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export="" data-lt="BoxQuadOptions" id="dictdef-boxquadoptions">BoxQuadOptions<span class="dfn-panel" data-deco=""><b><a href="#dictdef-boxquadoptions">#dictdef-boxquadoptions</a></b><b>Referenced in:</b><span><a href="#ref-for-dictdef-boxquadoptions-1">11.1. The GeometryUtils Interface</a></span></span></dfn> { <a data-link-type="idl-name" href="#enumdef-cssboxtype" id="ref-for-enumdef-cssboxtype-1">CSSBoxType</a> <dfn class="idl-code" data-default=""border"" data-dfn-for="BoxQuadOptions" data-dfn-type="dict-member" data-export="" data-type="CSSBoxType " id="dom-boxquadoptions-box">box<a class="self-link" href="#dom-boxquadoptions-box"></a></dfn> = "border"; <a data-link-type="idl-name" href="#typedefdef-geometrynode" id="ref-for-typedefdef-geometrynode-1">GeometryNode</a> <dfn class="idl-code" data-dfn-for="BoxQuadOptions" data-dfn-type="dict-member" data-export="" data-type="GeometryNode " id="dom-boxquadoptions-relativeto">relativeTo<a class="self-link" href="#dom-boxquadoptions-relativeto"></a></dfn>; // XXX default document (i.e. viewport) }; dictionary <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export="" data-lt="ConvertCoordinateOptions" id="dictdef-convertcoordinateoptions">ConvertCoordinateOptions<span class="dfn-panel" data-deco=""><b><a href="#dictdef-convertcoordinateoptions">#dictdef-convertcoordinateoptions</a></b><b>Referenced in:</b><span><a href="#ref-for-dictdef-convertcoordinateoptions-1">11.1. The GeometryUtils Interface</a> <a href="#ref-for-dictdef-convertcoordinateoptions-2">(2)</a> <a href="#ref-for-dictdef-convertcoordinateoptions-3">(3)</a></span></span></dfn> { <a data-link-type="idl-name" href="#enumdef-cssboxtype" id="ref-for-enumdef-cssboxtype-2">CSSBoxType</a> <dfn class="idl-code" data-default=""border"" data-dfn-for="ConvertCoordinateOptions" data-dfn-type="dict-member" data-export="" data-type="CSSBoxType " id="dom-convertcoordinateoptions-frombox">fromBox<a class="self-link" href="#dom-convertcoordinateoptions-frombox"></a></dfn> = "border"; <a data-link-type="idl-name" href="#enumdef-cssboxtype" id="ref-for-enumdef-cssboxtype-3">CSSBoxType</a> <dfn class="idl-code" data-default=""border"" data-dfn-for="ConvertCoordinateOptions" data-dfn-type="dict-member" data-export="" data-type="CSSBoxType " id="dom-convertcoordinateoptions-tobox">toBox<a class="self-link" href="#dom-convertcoordinateoptions-tobox"></a></dfn> = "border"; }; [NoInterfaceObject] interface <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export="" data-lt="GeometryUtils" id="geometryutils">GeometryUtils<span class="dfn-panel" data-deco=""><b><a href="#geometryutils">#geometryutils</a></b><b>Referenced in:</b><span><a href="#ref-for-geometryutils-1">11.1. The GeometryUtils Interface</a> <a href="#ref-for-geometryutils-2">(2)</a> <a href="#ref-for-geometryutils-3">(3)</a> <a href="#ref-for-geometryutils-4">(4)</a> <a href="#ref-for-geometryutils-5">(5)</a></span></span></dfn> { sequence<<a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domquad">DOMQuad</a>> <a class="idl-code" data-link-type="method" href="#dom-geometryutils-getboxquads" id="ref-for-dom-geometryutils-getboxquads-1">getBoxQuads</a>(optional <a data-link-type="idl-name" href="#dictdef-boxquadoptions" id="ref-for-dictdef-boxquadoptions-1">BoxQuadOptions</a> <dfn class="idl-code" data-dfn-for="GeometryUtils/getBoxQuads(options), GeometryUtils/getBoxQuads()" data-dfn-type="argument" data-export="" id="dom-geometryutils-getboxquads-options-options">options<a class="self-link" href="#dom-geometryutils-getboxquads-options-options"></a></dfn>); <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domquad">DOMQuad</a> <a class="idl-code" data-link-type="method" href="#dom-geometryutils-convertquadfromnode" id="ref-for-dom-geometryutils-convertquadfromnode-1">convertQuadFromNode</a>(<a data-link-type="idl-name" href="https://drafts.fxtf.org/geometry-1/#dictdef-domquadinit">DOMQuadInit</a> <dfn class="idl-code" data-dfn-for="GeometryUtils/convertQuadFromNode(quad, from, options), GeometryUtils/convertQuadFromNode(quad, from)" data-dfn-type="argument" data-export="" id="dom-geometryutils-convertquadfromnode-quad-from-options-quad">quad<a class="self-link" href="#dom-geometryutils-convertquadfromnode-quad-from-options-quad"></a></dfn>, <a data-link-type="idl-name" href="#typedefdef-geometrynode" id="ref-for-typedefdef-geometrynode-2">GeometryNode</a> <dfn class="idl-code" data-dfn-for="GeometryUtils/convertQuadFromNode(quad, from, options), GeometryUtils/convertQuadFromNode(quad, from)" data-dfn-type="argument" data-export="" id="dom-geometryutils-convertquadfromnode-quad-from-options-from">from<a class="self-link" href="#dom-geometryutils-convertquadfromnode-quad-from-options-from"></a></dfn>, optional <a data-link-type="idl-name" href="#dictdef-convertcoordinateoptions" id="ref-for-dictdef-convertcoordinateoptions-1">ConvertCoordinateOptions</a> <dfn class="idl-code" data-dfn-for="GeometryUtils/convertQuadFromNode(quad, from, options), GeometryUtils/convertQuadFromNode(quad, from)" data-dfn-type="argument" data-export="" id="dom-geometryutils-convertquadfromnode-quad-from-options-options">options<a class="self-link" href="#dom-geometryutils-convertquadfromnode-quad-from-options-options"></a></dfn>); <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domquad">DOMQuad</a> <a class="idl-code" data-link-type="method" href="#dom-geometryutils-convertrectfromnode" id="ref-for-dom-geometryutils-convertrectfromnode-1">convertRectFromNode</a>(<a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrectreadonly">DOMRectReadOnly</a> <dfn class="idl-code" data-dfn-for="GeometryUtils/convertRectFromNode(rect, from, options), GeometryUtils/convertRectFromNode(rect, from)" data-dfn-type="argument" data-export="" id="dom-geometryutils-convertrectfromnode-rect-from-options-rect">rect<a class="self-link" href="#dom-geometryutils-convertrectfromnode-rect-from-options-rect"></a></dfn>, <a data-link-type="idl-name" href="#typedefdef-geometrynode" id="ref-for-typedefdef-geometrynode-3">GeometryNode</a> <dfn class="idl-code" data-dfn-for="GeometryUtils/convertRectFromNode(rect, from, options), GeometryUtils/convertRectFromNode(rect, from)" data-dfn-type="argument" data-export="" id="dom-geometryutils-convertrectfromnode-rect-from-options-from">from<a class="self-link" href="#dom-geometryutils-convertrectfromnode-rect-from-options-from"></a></dfn>, optional <a data-link-type="idl-name" href="#dictdef-convertcoordinateoptions" id="ref-for-dictdef-convertcoordinateoptions-2">ConvertCoordinateOptions</a> <dfn class="idl-code" data-dfn-for="GeometryUtils/convertRectFromNode(rect, from, options), GeometryUtils/convertRectFromNode(rect, from)" data-dfn-type="argument" data-export="" id="dom-geometryutils-convertrectfromnode-rect-from-options-options">options<a class="self-link" href="#dom-geometryutils-convertrectfromnode-rect-from-options-options"></a></dfn>); <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-dompoint">DOMPoint</a> <a class="idl-code" data-link-type="method" href="#dom-geometryutils-convertpointfromnode" id="ref-for-dom-geometryutils-convertpointfromnode-1">convertPointFromNode</a>(<a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dictdef-dompointinit">DOMPointInit</a> <dfn class="idl-code" data-dfn-for="GeometryUtils/convertPointFromNode(point, from, options), GeometryUtils/convertPointFromNode(point, from)" data-dfn-type="argument" data-export="" id="dom-geometryutils-convertpointfromnode-point-from-options-point">point<a class="self-link" href="#dom-geometryutils-convertpointfromnode-point-from-options-point"></a></dfn>, <a data-link-type="idl-name" href="#typedefdef-geometrynode" id="ref-for-typedefdef-geometrynode-4">GeometryNode</a> <dfn class="idl-code" data-dfn-for="GeometryUtils/convertPointFromNode(point, from, options), GeometryUtils/convertPointFromNode(point, from)" data-dfn-type="argument" data-export="" id="dom-geometryutils-convertpointfromnode-point-from-options-from">from<a class="self-link" href="#dom-geometryutils-convertpointfromnode-point-from-options-from"></a></dfn>, optional <a data-link-type="idl-name" href="#dictdef-convertcoordinateoptions" id="ref-for-dictdef-convertcoordinateoptions-3">ConvertCoordinateOptions</a> <dfn class="idl-code" data-dfn-for="GeometryUtils/convertPointFromNode(point, from, options), GeometryUtils/convertPointFromNode(point, from)" data-dfn-type="argument" data-export="" id="dom-geometryutils-convertpointfromnode-point-from-options-options">options<a class="self-link" href="#dom-geometryutils-convertpointfromnode-point-from-options-options"></a></dfn>); // XXX z,w turns into 0 }; <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#text">Text</a> implements <a data-link-type="idl-name" href="#geometryutils" id="ref-for-geometryutils-2">GeometryUtils</a>; // like Range <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a> implements <a data-link-type="idl-name" href="#geometryutils" id="ref-for-geometryutils-3">GeometryUtils</a>; <a data-link-type="idl-name" href="https://www.w3.org/TR/css-pseudo-4/#csspseudoelement">CSSPseudoElement</a> implements <a data-link-type="idl-name" href="#geometryutils" id="ref-for-geometryutils-4">GeometryUtils</a>; <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#document">Document</a> implements <a data-link-type="idl-name" href="#geometryutils" id="ref-for-geometryutils-5">GeometryUtils</a>; typedef (<a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#text">Text</a> or <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a> or <a data-link-type="idl-name" href="https://www.w3.org/TR/css-pseudo-4/#csspseudoelement">CSSPseudoElement</a> or <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#document">Document</a>) <dfn class="dfn-paneled idl-code" data-dfn-type="typedef" data-export="" data-lt="GeometryNode" id="typedefdef-geometrynode">GeometryNode<span class="dfn-panel" data-deco=""><b><a href="#typedefdef-geometrynode">#typedefdef-geometrynode</a></b><b>Referenced in:</b><span><a href="#ref-for-typedefdef-geometrynode-1">11.1. The GeometryUtils Interface</a> <a href="#ref-for-typedefdef-geometrynode-2">(2)</a> <a href="#ref-for-typedefdef-geometrynode-3">(3)</a> <a href="#ref-for-typedefdef-geometrynode-4">(4)</a></span></span></dfn>; </pre> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="GeometryUtils" data-dfn-type="method" data-export="" data-lt="getBoxQuads(options)|getBoxQuads()" id="dom-geometryutils-getboxquads">getBoxQuads(<var>options</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-geometryutils-getboxquads">#dom-geometryutils-getboxquads</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-geometryutils-getboxquads-1">11.1. The GeometryUtils Interface</a></span></span></dfn> method must run the following steps:</p> <ol> <li class="issue" id="issue-c925384b"> <a class="self-link" href="#issue-c925384b"></a> DOM order <p>p1 = top left even in RTL</p> <p>scale to 0 means divide by zero, return 0x0</p> <p>cross-frames not allowed, throw WrongDocumentError?</p> <p>points are flattened (3d transform), z=0. like getClientRect</p> <p>test block in inline</p> <p>pseudo-elements before/after are children of the element</p> <p>viewport boxes are all the same</p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="GeometryUtils" data-dfn-type="method" data-export="" data-lt="convertQuadFromNode(quad, from, options)|convertQuadFromNode(quad, from)" id="dom-geometryutils-convertquadfromnode">convertQuadFromNode(<var>quad</var>, <var>from</var>, <var>options</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-geometryutils-convertquadfromnode">#dom-geometryutils-convertquadfromnode</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-geometryutils-convertquadfromnode-1">11.1. The GeometryUtils Interface</a></span></span></dfn> method must run the following steps:</p> <ol> <li> <p class="issue" id="issue-2f43b42f"><a class="self-link" href="#issue-2f43b42f"></a>... </p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="GeometryUtils" data-dfn-type="method" data-export="" data-lt="convertRectFromNode(rect, from, options)|convertRectFromNode(rect, from)" id="dom-geometryutils-convertrectfromnode">convertRectFromNode(<var>rect</var>, <var>from</var>, <var>options</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-geometryutils-convertrectfromnode">#dom-geometryutils-convertrectfromnode</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-geometryutils-convertrectfromnode-1">11.1. The GeometryUtils Interface</a></span></span></dfn> method must run the following steps:</p> <ol> <li> <p class="issue" id="issue-2f43b42f0"><a class="self-link" href="#issue-2f43b42f0"></a>... </p> </ol> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="GeometryUtils" data-dfn-type="method" data-export="" data-lt="convertPointFromNode(point, from, options)|convertPointFromNode(point, from)" id="dom-geometryutils-convertpointfromnode">convertPointFromNode(<var>point</var>, <var>from</var>, <var>options</var>)<span class="dfn-panel" data-deco=""><b><a href="#dom-geometryutils-convertpointfromnode">#dom-geometryutils-convertpointfromnode</a></b><b>Referenced in:</b><span><a href="#ref-for-dom-geometryutils-convertpointfromnode-1">11.1. The GeometryUtils Interface</a></span></span></dfn> method must run the following steps:</p> <ol> <li> <p class="issue" id="issue-2f43b42f1"><a class="self-link" href="#issue-2f43b42f1"></a>... </p> </ol> <h2 class="heading settled" data-level="12" id="events"><span class="secno">12. </span><span class="content">Events</span><a class="self-link" href="#events"></a></h2> <h3 class="heading settled" data-level="12.1" id="resizing-viewports"><span class="secno">12.1. </span><span class="content">Resizing viewports</span><a class="self-link" href="#resizing-viewports"></a></h3> <p>This section integrates with the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop">event loop</a> defined in HTML. <a data-link-type="biblio" href="#biblio-html">[HTML]</a></p> <p>When asked to <dfn data-dfn-type="dfn" data-noexport="" id="run-the-resize-steps">run the resize steps<a class="self-link" href="#run-the-resize-steps"></a></dfn> for a <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> <var>doc</var>, run these steps:</p> <ol> <li data-md=""> <p>If <var>doc</var>’s <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-81">viewport</a> has had its width or height changed (e.g. as a result of the user resizing the browser window, or changing the <span>page zoom</span> scale factor, or an <code>iframe</code> element’s dimensions are changed) since the last time these steps were run, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire">fire an event</a> named <a class="idl-code" data-link-type="event" href="#eventdef-window-resize" id="ref-for-eventdef-window-resize-1">resize</a> at the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a></code> object associated with <var>doc</var>.</p> </ol> <h3 class="heading settled" data-level="12.2" id="scrolling-events"><span class="secno">12.2. </span><span class="content">Scrolling</span><a class="self-link" href="#scrolling-events"></a></h3> <p>This section integrates with the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop">event loop</a> defined in HTML. <a data-link-type="biblio" href="#biblio-html">[HTML]</a></p> <p>Each <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> has an associated list of <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="pending scroll event targets" data-noexport="" id="pending-scroll-event-targets">pending scroll event targets<span class="dfn-panel" data-deco=""><b><a href="#pending-scroll-event-targets">#pending-scroll-event-targets</a></b><b>Referenced in:</b><span><a href="#ref-for-pending-scroll-event-targets-1">12.2. Scrolling</a> <a href="#ref-for-pending-scroll-event-targets-2">(2)</a> <a href="#ref-for-pending-scroll-event-targets-3">(3)</a> <a href="#ref-for-pending-scroll-event-targets-4">(4)</a> <a href="#ref-for-pending-scroll-event-targets-5">(5)</a> <a href="#ref-for-pending-scroll-event-targets-6">(6)</a></span></span></dfn>, initially empty.</p> <p>Whenever a <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-82">viewport</a> gets scrolled (whether in response to user interaction or by an API), the user agent must run these steps:</p> <ol> <li data-md=""> <p>Let <var>doc</var> be the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-83">viewport’s</a> associated <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code>.</p> <li data-md=""> <p>If <var>doc</var> is already in <var>doc</var>’s <a data-link-type="dfn" href="#pending-scroll-event-targets" id="ref-for-pending-scroll-event-targets-1">pending scroll event targets</a>, abort these steps.</p> <li data-md=""> <p>Append <var>doc</var> to <var>doc</var>’s <a data-link-type="dfn" href="#pending-scroll-event-targets" id="ref-for-pending-scroll-event-targets-2">pending scroll event targets</a>.</p> </ol> <p>Whenever an element gets scrolled (whether in response to user interaction or by an API), the user agent must run these steps:</p> <ol> <li data-md=""> <p>Let <var>doc</var> be the element’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>.</p> <li data-md=""> <p>If the element is already in <var>doc</var>’s <a data-link-type="dfn" href="#pending-scroll-event-targets" id="ref-for-pending-scroll-event-targets-3">pending scroll event targets</a>, abort these steps.</p> <li data-md=""> <p>Append the element to <var>doc</var>’s <a data-link-type="dfn" href="#pending-scroll-event-targets" id="ref-for-pending-scroll-event-targets-4">pending scroll event targets</a>.</p> </ol> <p>When asked to <dfn data-dfn-type="dfn" data-noexport="" id="run-the-scroll-steps">run the scroll steps<a class="self-link" href="#run-the-scroll-steps"></a></dfn> for a <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> <var>doc</var>, run these steps:</p> <ol> <li data-md=""> <p>For each item <var>target</var> in <var>doc</var>’s <a data-link-type="dfn" href="#pending-scroll-event-targets" id="ref-for-pending-scroll-event-targets-5">pending scroll event targets</a>, in the order they were added to the list, run these substeps:</p> <ol> <li data-md=""> <p>If <var>target</var> is a <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code>, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire">fire an event</a> named <a class="idl-code" data-link-type="event" href="#eventdef-document-scroll" id="ref-for-eventdef-document-scroll-1">scroll</a> that bubbles at <var>target</var>.</p> <li data-md=""> <p>Otherwise, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire">fire an event</a> named <a class="idl-code" data-link-type="event" href="#eventdef-document-scroll" id="ref-for-eventdef-document-scroll-2">scroll</a> at <var>target</var>.</p> </ol> <li data-md=""> <p>Empty <var>doc</var>’s <a data-link-type="dfn" href="#pending-scroll-event-targets" id="ref-for-pending-scroll-event-targets-6">pending scroll event targets</a>.</p> </ol> <h3 class="heading settled" data-level="12.3" id="event-summary"><span class="secno">12.3. </span><span class="content">Event summary</span><a class="self-link" href="#event-summary"></a></h3> <p><i>This section is non-normative.</i></p> <table class="complex data"> <thead> <tr> <th>Event <th>Interface <th>Interesting targets <th>Description <tbody> <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="Window" data-dfn-type="event" data-export="" data-lt="resize" id="eventdef-window-resize">resize<span class="dfn-panel" data-deco=""><b><a href="#eventdef-window-resize">#eventdef-window-resize</a></b><b>Referenced in:</b><span><a href="#ref-for-eventdef-window-resize-1">12.1. Resizing viewports</a></span><span><a href="#ref-for-eventdef-window-resize-2">Changes From 17 December 2013</a></span></span></dfn> <td><code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#event">Event</a></code> <td><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a></code> <td>Fired at the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a></code> when the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-84">viewport</a> is resized. <tr> <td><dfn class="dfn-paneled idl-code" data-dfn-for="Document, Element" data-dfn-type="event" data-export="" data-lt="scroll" id="eventdef-document-scroll">scroll<span class="dfn-panel" data-deco=""><b><a href="#eventdef-document-scroll">#eventdef-document-scroll</a></b><b>Referenced in:</b><span><a href="#ref-for-eventdef-document-scroll-1">12.2. Scrolling</a> <a href="#ref-for-eventdef-document-scroll-2">(2)</a></span><span><a href="#ref-for-eventdef-document-scroll-3">Changes From 17 December 2013</a></span></span></dfn> <td><code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#event">Event</a></code> <td><code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code>, elements <td>Fired at the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> or element when the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-85">viewport</a> or element is scrolled, respectively. </table> <h2 class="heading settled" data-level="13" id="css-properties"><span class="secno">13. </span><span class="content">CSS properties</span><a class="self-link" href="#css-properties"></a></h2> <p class="issue" id="issue-e12d69d6"><a class="self-link" href="#issue-e12d69d6"></a> The features in this section should be moved to some other specification.</p> <h3 class="heading settled" data-level="13.1" id="smooth-scrolling"><span class="secno">13.1. </span><span class="content">Smooth Scrolling: The <a class="property" data-link-type="propdesc" href="#propdef-scroll-behavior" id="ref-for-propdef-scroll-behavior-3">scroll-behavior</a> Property</span><a class="self-link" href="#smooth-scrolling"></a></h3> <table class="def propdef" data-link-for-hint="<dfn>scroll-behavior</dfn>"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export="" data-lt="scroll-behavior" id="propdef-scroll-behavior">scroll-behavior<span class="dfn-panel" data-deco=""><b><a href="#propdef-scroll-behavior">#propdef-scroll-behavior</a></b><b>Referenced in:</b><span><a href="#ref-for-propdef-scroll-behavior-1">3.1. Scrolling</a> <a href="#ref-for-propdef-scroll-behavior-2">(2)</a></span><span><a href="#ref-for-propdef-scroll-behavior-3">13.1. Smooth Scrolling: The scroll-behavior Property</a> <a href="#ref-for-propdef-scroll-behavior-4">(2)</a> <a href="#ref-for-propdef-scroll-behavior-5">(3)</a></span><span><a href="#ref-for-propdef-scroll-behavior-6">Changes From 17 December 2013</a></span><span><a href="#ref-for-propdef-scroll-behavior-7">Changes From 4 August 2011 To 17 December 2013</a></span></span></dfn> <tr class="value"> <th>Value: <td class="prod">auto <a data-link-type="grammar" href="https://www.w3.org/TR/css3-values/#comb-one">|</a> smooth <tr> <th>Initial: <td>auto <tr> <th>Applies to: <td><a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-13">scrolling boxes</a> <tr> <th>Inherited: <td>no <tr> <th>Percentages: <td>n/a <tr> <th>Media: <td>visual <tr> <th>Computed value: <td>specified value <tr> <th>Animatable: <td>no <tr> <th>Canonical order: <td>per grammar </table> <p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-behavior" id="ref-for-propdef-scroll-behavior-4">scroll-behavior</a> property specifies the scrolling behavior for a <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-14">scrolling box</a>, when scrolling happens due to navigation or CSSOM scrolling APIs. Any other scrolls, e.g. those that are performed by the user, are not affected by this property. When this property is specified on the root element, it applies to the <a data-link-type="dfn" href="#viewport" id="ref-for-viewport-86">viewport</a> instead.</p> <p class="note" role="note">The <a class="property" data-link-type="propdesc" href="#propdef-scroll-behavior" id="ref-for-propdef-scroll-behavior-5">scroll-behavior</a> property of the HTML <code>body</code> element is <em>not</em> propagated to the viewport. </p> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="scroll-behavior" data-dfn-type="value" data-export="" data-lt="auto" id="valdef-scroll-behavior-auto">auto<span class="dfn-panel" data-deco=""><b><a href="#valdef-scroll-behavior-auto">#valdef-scroll-behavior-auto</a></b><b>Referenced in:</b><span><a href="#ref-for-valdef-scroll-behavior-auto-1">Changes From 17 December 2013</a></span></span></dfn> <dd>The <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-15">scrolling box</a> is scrolled in an instant fashion. <dt><dfn class="dfn-paneled css" data-dfn-for="scroll-behavior" data-dfn-type="value" data-export="" data-lt="smooth" id="valdef-scroll-behavior-smooth">smooth<span class="dfn-panel" data-deco=""><b><a href="#valdef-scroll-behavior-smooth">#valdef-scroll-behavior-smooth</a></b><b>Referenced in:</b><span><a href="#ref-for-valdef-scroll-behavior-smooth-1">3.1. Scrolling</a></span></span></dfn> <dd>The <a data-link-type="dfn" href="#scrolling-box" id="ref-for-scrolling-box-16">scrolling box</a> is scrolled in a smooth fashion using a user-agent-defined timing function over a user-agent-defined period of time. User agents should follow platform conventions, if any. </dl> <p>User agents may ignore this property. </p> <h2 class="no-num heading settled" id="change-history"><span class="content">Change History</span><a class="self-link" href="#change-history"></a></h2> <p>This section documents some of the changes between publications of this specification. This section is not exhaustive. Bug fixes and editorial changes are generally not listed.</p> <h3 class="no-num heading settled" id="changes-from-2013-12-17"><span class="content">Changes From 17 December 2013</span><a class="self-link" href="#changes-from-2013-12-17"></a></h3> <ul> <li data-md=""> <p>The <code class="idl"><a data-link-type="idl" href="#dom-element-scrollintoview" id="ref-for-dom-element-scrollintoview-3">scrollIntoView()</a></code> method on <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element">Element</a></code> was changed and extended.</p> <li data-md=""> <p>The <code class="idl"><a data-link-type="idl" href="#dom-element-scrolltop" id="ref-for-dom-element-scrolltop-6">scrollTop</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-element-scrollleft" id="ref-for-dom-element-scrollleft-6">scrollLeft</a></code> IDL attributes on <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element">Element</a></code> changed to no longer take an object; the <code class="idl"><a data-link-type="idl" href="#dom-element-scroll" id="ref-for-dom-element-scroll-5">scroll()</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-element-scrollto" id="ref-for-dom-element-scrollto-3">scrollTo()</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-element-scrollby" id="ref-for-dom-element-scrollby-3">scrollBy()</a></code> methods were added instead.</p> <li data-md=""> <p>The <code class="idl"><a data-link-type="idl" href="#dom-element-scrollwidth" id="ref-for-dom-element-scrollwidth-2">scrollWidth</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-element-scrollheight" id="ref-for-dom-element-scrollheight-2">scrollHeight</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-element-clienttop" id="ref-for-dom-element-clienttop-2">clientTop</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-element-clientleft" id="ref-for-dom-element-clientleft-2">clientLeft</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-element-clientwidth" id="ref-for-dom-element-clientwidth-2">clientWidth</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-element-clientheight" id="ref-for-dom-element-clientheight-2">clientHeight</a></code> IDL attributes on <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element">Element</a></code> were changed back to return integers.</p> <li data-md=""> <p>The <code>DOMRectList</code> interface was removed.</p> <li data-md=""> <p>The <code class="idl"><a data-link-type="idl" href="#dom-document-scrollingelement" id="ref-for-dom-document-scrollingelement-3">scrollingElement</a></code> IDL attribute on <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document">Document</a></code> was added.</p> <li data-md=""> <p>Some readonly attributes on <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a></code> were annotated with <code>[Replaceable]</code> IDL extended attribute.</p> <li data-md=""> <p><code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-13">MediaQueryList</a></code>, <a class="idl-code" data-link-type="event" href="#eventdef-document-scroll" id="ref-for-eventdef-document-scroll-3">scroll</a> event and <a class="idl-code" data-link-type="event" href="#eventdef-window-resize" id="ref-for-eventdef-window-resize-2">resize</a> event are integrated with the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop">event loop</a> in HTML so they are synchronized with animation frames.</p> <li data-md=""> <p>The <code>instant</code> value of <a class="property" data-link-type="propdesc" href="#propdef-scroll-behavior" id="ref-for-propdef-scroll-behavior-6">scroll-behavior</a> was renamed to <a class="css" data-link-type="maybe" href="#valdef-scroll-behavior-auto" id="ref-for-valdef-scroll-behavior-auto-1">auto</a>.</p> <li data-md=""> <p>The origin of <code class="idl"><a data-link-type="idl" href="#dom-element-scrollleft" id="ref-for-dom-element-scrollleft-7">scrollLeft</a></code> on <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element">Element</a></code> was changed (for RTL).</p> <li data-md=""> <p>The <code class="idl"><a data-link-type="idl" href="#dom-element-scrollintoview" id="ref-for-dom-element-scrollintoview-4">scrollIntoView()</a></code> method on <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element">Element</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-window-scroll" id="ref-for-dom-window-scroll-11">scroll()</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-window-scrollto" id="ref-for-dom-window-scrollto-3">scrollTo()</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-window-scrollby" id="ref-for-dom-window-scrollby-3">scrollBy()</a></code> methods on <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a></code> take the relevant dictionary as the first argument.</p> <li data-md=""> <p>The <code class="idl"><a data-link-type="idl" href="#mediaquerylist" id="ref-for-mediaquerylist-14">MediaQueryList</a></code> interface was changed to use regular event API and define <code class="idl"><a data-link-type="idl" href="#dom-mediaquerylist-addlistener" id="ref-for-dom-mediaquerylist-addlistener-4">addListener()</a></code> in terms of that.</p> </ul> <h3 class="no-num heading settled" id="changes-from-2011-08-04"><span class="content">Changes From 4 August 2011 To 17 December 2013</span><a class="self-link" href="#changes-from-2011-08-04"></a></h3> <ul> <li data-md=""> <p>The specification now handles right-to-left and vertical writing modes.</p> <li data-md=""> <p>The specification is now aware of <a data-link-type="dfn" href="#page-zoom" id="ref-for-page-zoom-2">page zoom</a> and <a data-link-type="dfn" href="#pinch-zoom" id="ref-for-pinch-zoom-2">pinch zoom</a>.</p> <li data-md=""> <p>The <a class="property" data-link-type="propdesc" href="#propdef-scroll-behavior" id="ref-for-propdef-scroll-behavior-7">scroll-behavior</a> CSS property is introduced and scrolling APIs are extended with a mechanism to control smooth scrolling.</p> <li data-md=""> <p>The <code class="idl"><a data-link-type="idl" href="#dom-window-moveto" id="ref-for-dom-window-moveto-2">moveTo()</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-window-moveby" id="ref-for-dom-window-moveby-2">moveBy()</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-window-resizeto" id="ref-for-dom-window-resizeto-2">resizeTo()</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-window-resizeby" id="ref-for-dom-window-resizeby-2">resizeBy()</a></code> methods are now defined.</p> <li data-md=""> <p><code class="idl"><a data-link-type="idl" href="#dom-window-innerwidth" id="ref-for-dom-window-innerwidth-2">innerWidth</a></code> et al now use the WebIDL type <code class="idl"><a data-link-type="idl" href="http://heycam.github.io/webidl/#idl-double">double</a></code> instead of <code class="idl"><a data-link-type="idl" href="http://heycam.github.io/webidl/#idl-long">long</a></code>.</p> <li data-md=""> <p><code class="idl"><a data-link-type="idl" href="#dom-window-devicepixelratio" id="ref-for-dom-window-devicepixelratio-2">devicePixelRatio</a></code> is now defined.</p> <li data-md=""> <p>The <code>features</code> argument to <a class="idl-code" data-link-type="method" href="https://html.spec.whatwg.org/multipage/browsers.html#dom-open">window.open()</a> is now defined.</p> <li data-md=""> <p>The <code class="idl"><a data-link-type="idl" href="#dom-screen-colordepth" id="ref-for-dom-screen-colordepth-3">colorDepth</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-screen-pixeldepth" id="ref-for-dom-screen-pixeldepth-3">pixelDepth</a></code> attributes of <code class="idl"><a data-link-type="idl" href="#screen" id="ref-for-screen-5">Screen</a></code> now always return 24.</p> <li data-md=""> <p>The <code class="idl"><a data-link-type="idl" href="#dom-document-elementsfrompoint" id="ref-for-dom-document-elementsfrompoint-2">elementsFromPoint()</a></code> method of <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#element">Element</a></code> is introduced.</p> <li data-md=""> <p>The specification is now aware of <a data-link-type="dfn" href="#transforms" id="ref-for-transforms-24">transforms</a>.</p> <li data-md=""> <p>Some geometry utility APIs are introduced but are not yet specified.</p> <li data-md=""> <p><code>ClientRect</code> has been renamed to <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a></code> and has moved to the Geometry specification. <a data-link-type="biblio" href="#biblio-geometry-1">[GEOMETRY-1]</a></p> <li data-md=""> <p>The specification now defines when the <code>resize</code> and <code>scroll</code> events fire.</p> </ul> <h2 class="no-num heading settled" id="acks"><span class="content">Acknowledgments</span><a class="self-link" href="#acks"></a></h2> <p>The editors would like to thank Alan Stearns, Alexey Feldgendler, Antonio Gomes, Björn Höhrmann, Boris Zbarsky, Chris Rebert, Dan Bates, David Vest, Elliott Sprehn, Garrett Smith, Henrik Andersson, Hallvord R. M. Steen, Kang-Hao Lu, Leif Arne Storset, Luiz Agostini, Maciej Stachowiak, Michael Dyck, Mike Wilson, Morten Stenshorne, Olli Pettay, Pavel Curtis, Peter-Paul Koch, Rachel Kmetz, Rick Byers, Robert O’Callahan, Sam Weinig, Scott Johnson, Sebastian Zartner, Stewart Brodie, Sylvain Galineau, Tab Atkins, Tarquin Wilton-Jones, Thomas Moore, Thomas Shinnick, and Xiaomei Ji for their contributions to this document.</p> <p>Special thanks to the Microsoft employees who first implemented many of the features specified in this draft, which were first widely deployed by the Windows Internet Explorer browser.</p> </main> <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2> <h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3> <p>Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification. </p> <p>All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p> <p>Examples in this specification are introduced with the words “for example” or are set apart from the normative text with <code>class="example"</code>, like this: </p> <div class="example" id="example-52448c84"> <a class="self-link" href="#example-52448c84"></a> <p>This is an example of an informative example. </p> </div> <p>Informative notes begin with the word “Note” and are set apart from the normative text with <code>class="note"</code>, like this: </p> <p class="note" role="note">Note, this is an informative note. </p> <p>Advisements are normative sections styled to evoke special attention and are set apart from other normative text with <code><strong class="advisement"></code>, like this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p> <h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3> <p>Conformance to this specification is defined for three conformance classes: </p> <dl> <dt>style sheet <dd>A <a href="https://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS style sheet</a>. <dt>renderer <dd>A <a href="https://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders documents that use them. <dt>authoring tool <dd>A <a href="https://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet. </dl> <p>A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module. </p> <p>A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.) </p> <p>An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module. </p> <h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3> <p>The following sections define several conformance requirements for implementing CSS responsibly, in a way that promotes interoperability in the present and future. </p> <h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4> <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid (and <a href="https://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support</strong>. In particular, user agents <em>must not</em> selectively ignore unsupported property values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored. </p> <h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4> <p>To avoid clashes with future stable CSS features, the CSSWG recommends <a href="https://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="https://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="https://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p> <h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4> <p>Once a specification reaches the Candidate Recommendation stage, implementers should release an <a data-link-type="dfn" href="https://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec, and should avoid exposing a prefixed variant of that feature. </p> <p>To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group. </p> <p> Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at <a href="https://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>. Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. <script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script> </p> <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2> <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3> <ul class="index"> <li><a href="#dom-mediaquerylist-addlistener">addListener(listener)</a><span>, in §4.2</span> <li><a href="#allowed-to-resize-and-move">allowed to resize and move</a><span>, in §4</span> <li><a href="#valdef-scroll-behavior-auto">auto</a><span>, in §13.1</span> <li><a href="#dom-scrollbehavior-auto">"auto"</a><span>, in §4</span> <li><a href="#dom-screen-availheight">availHeight</a><span>, in §4.3</span> <li><a href="#dom-screen-availwidth">availWidth</a><span>, in §4.3</span> <li><a href="#beginning-edges">beginning edges</a><span>, in §2</span> <li><a href="#dom-scrolloptions-behavior">behavior</a><span>, in §4</span> <li><a href="#dom-scrollintoviewoptions-block">block</a><span>, in §6</span> <li><a href="#dom-cssboxtype-border">"border"</a><span>, in §11.1</span> <li><a href="#border-edge">border edge</a><span>, in §2</span> <li><a href="#dom-boxquadoptions-box">box</a><span>, in §11.1</span> <li><a href="#dictdef-boxquadoptions">BoxQuadOptions</a><span>, in §11.1</span> <li><a href="#caret-node">caret node</a><span>, in §5.1</span> <li><a href="#caret-offset">caret offset</a><span>, in §5.1</span> <li><a href="#caret-position">caret position</a><span>, in §5.1</span> <li><a href="#caretposition">CaretPosition</a><span>, in §5.1</span> <li><a href="#dom-document-caretpositionfrompoint">caretPositionFromPoint(x, y)</a><span>, in §5</span> <li><a href="#caret-range">caret range</a><span>, in §5.1</span> <li><a href="#dom-scrolllogicalposition-center">"center"</a><span>, in §6</span> <li><a href="#eventdef-mediaquerylist-change">change</a><span>, in §4.2.1</span> <li><a href="#dom-element-clientheight">clientHeight</a><span>, in §6</span> <li><a href="#dom-element-clientleft">clientLeft</a><span>, in §6</span> <li><a href="#dom-element-clienttop">clientTop</a><span>, in §6</span> <li><a href="#dom-element-clientwidth">clientWidth</a><span>, in §6</span> <li> clientX <ul> <li><a href="#dom-mouseeventinit-clientx">dict-member for MouseEventInit</a><span>, in §10</span> <li><a href="#dom-mouseevent-clientx">attribute for MouseEvent</a><span>, in §10</span> </ul> <li> clientY <ul> <li><a href="#dom-mouseeventinit-clienty">dict-member for MouseEventInit</a><span>, in §10</span> <li><a href="#dom-mouseevent-clienty">attribute for MouseEvent</a><span>, in §10</span> </ul> <li><a href="#dom-screen-colordepth">colorDepth</a><span>, in §4.3</span> <li><a href="#dom-cssboxtype-content">"content"</a><span>, in §11.1</span> <li><a href="#content-edge">Content edge</a><span>, in §2</span> <li><a href="#dictdef-convertcoordinateoptions">ConvertCoordinateOptions</a><span>, in §11.1</span> <li><a href="#dom-geometryutils-convertpointfromnode">convertPointFromNode(point, from)</a><span>, in §11.1</span> <li><a href="#dom-geometryutils-convertpointfromnode">convertPointFromNode(point, from, options)</a><span>, in §11.1</span> <li><a href="#dom-geometryutils-convertquadfromnode">convertQuadFromNode(quad, from)</a><span>, in §11.1</span> <li><a href="#dom-geometryutils-convertquadfromnode">convertQuadFromNode(quad, from, options)</a><span>, in §11.1</span> <li><a href="#dom-geometryutils-convertrectfromnode">convertRectFromNode(rect, from)</a><span>, in §11.1</span> <li><a href="#dom-geometryutils-convertrectfromnode">convertRectFromNode(rect, from, options)</a><span>, in §11.1</span> <li><a href="#enumdef-cssboxtype">CSSBoxType</a><span>, in §11.1</span> <li><a href="#css-layout-box">CSS layout box</a><span>, in §2</span> <li><a href="#dom-window-devicepixelratio">devicePixelRatio</a><span>, in §4</span> <li><a href="#mediaquerylist-document">document</a><span>, in §4.2</span> <li><a href="#dom-document-elementfrompoint">elementFromPoint(x, y)</a><span>, in §5</span> <li><a href="#dom-document-elementsfrompoint">elementsFromPoint(x, y)</a><span>, in §5</span> <li><a href="#dom-scrolllogicalposition-end">"end"</a><span>, in §6</span> <li><a href="#ending-edges">ending edges</a><span>, in §2</span> <li><a href="#evaluate-media-queries-and-report-changes">evaluate media queries and report changes</a><span>, in §4.2</span> <li><a href="#dom-convertcoordinateoptions-frombox">fromBox</a><span>, in §11.1</span> <li><a href="#typedefdef-geometrynode">GeometryNode</a><span>, in §11.1</span> <li><a href="#geometryutils">GeometryUtils</a><span>, in §11.1</span> <li> getBoundingClientRect() <ul> <li><a href="#dom-element-getboundingclientrect">method for Element</a><span>, in §6</span> <li><a href="#dom-range-getboundingclientrect">method for Range</a><span>, in §9</span> </ul> <li><a href="#dom-geometryutils-getboxquads">getBoxQuads()</a><span>, in §11.1</span> <li><a href="#dom-geometryutils-getboxquads">getBoxQuads(options)</a><span>, in §11.1</span> <li><a href="#dom-caretposition-getclientrect">getClientRect()</a><span>, in §5.1</span> <li> getClientRects() <ul> <li><a href="#dom-element-getclientrects">method for Element</a><span>, in §6</span> <li><a href="#dom-range-getclientrects">method for Range</a><span>, in §9</span> </ul> <li> height <ul> <li><a href="#supported-open-feature-name-height">dfn for supported open() feature name</a><span>, in §4.1</span> <li><a href="#dom-screen-height">attribute for Screen</a><span>, in §4.3</span> </ul> <li><a href="#dom-scrollintoviewoptions-inline">inline</a><span>, in §6</span> <li><a href="#dom-window-innerheight">innerHeight</a><span>, in §4</span> <li><a href="#dom-window-innerwidth">innerWidth</a><span>, in §4</span> <li><a href="#dom-scrollbehavior-instant">"instant"</a><span>, in §4</span> <li><a href="#concept-instant-scroll">instant scroll</a><span>, in §3.1</span> <li><a href="#layout-box">layout box</a><span>, in §2</span> <li> left <ul> <li><a href="#dom-scrolltooptions-left">dict-member for ScrollToOptions</a><span>, in §4</span> <li><a href="#supported-open-feature-name-left">dfn for supported open() feature name</a><span>, in §4.1</span> </ul> <li><a href="#dom-cssboxtype-margin">"margin"</a><span>, in §11.1</span> <li><a href="#margin-edge">margin edge</a><span>, in §2</span> <li> matches <ul> <li><a href="#dom-mediaquerylist-matches">attribute for MediaQueryList</a><span>, in §4.2</span> <li><a href="#dom-mediaquerylisteventinit-matches">dict-member for MediaQueryListEventInit</a><span>, in §4.2</span> <li><a href="#dom-mediaquerylistevent-matches">attribute for MediaQueryListEvent</a><span>, in §4.2</span> </ul> <li><a href="#mediaquerylist-matches-state">matches state</a><span>, in §4.2</span> <li><a href="#dom-window-matchmedia">matchMedia(query)</a><span>, in §4</span> <li> media <ul> <li><a href="#mediaquerylist-media">dfn for MediaQueryList</a><span>, in §4.2</span> <li><a href="#dom-mediaquerylist-media">attribute for MediaQueryList</a><span>, in §4.2</span> <li><a href="#dom-mediaquerylisteventinit-media">dict-member for MediaQueryListEventInit</a><span>, in §4.2</span> <li><a href="#dom-mediaquerylistevent-media">attribute for MediaQueryListEvent</a><span>, in §4.2</span> </ul> <li><a href="#mediaquerylist">MediaQueryList</a><span>, in §4.2</span> <li><a href="#media-query-list">media query list</a><span>, in §4.2</span> <li><a href="#mediaquerylistevent">MediaQueryListEvent</a><span>, in §4.2</span> <li><a href="#dictdef-mediaquerylisteventinit">MediaQueryListEventInit</a><span>, in §4.2</span> <li><a href="#dom-mediaquerylistevent-mediaquerylistevent">MediaQueryListEvent(type)</a><span>, in §4.2</span> <li><a href="#dom-mediaquerylistevent-mediaquerylistevent">MediaQueryListEvent(type, eventInitDict)</a><span>, in §4.2</span> <li><a href="#dictdef-mouseeventinit">MouseEventInit</a><span>, in §10</span> <li><a href="#dom-window-moveby">moveBy(x, y)</a><span>, in §4</span> <li><a href="#dom-window-moveto">moveTo(x, y)</a><span>, in §4</span> <li><a href="#dom-scrolllogicalposition-nearest">"nearest"</a><span>, in §6</span> <li><a href="#normalize-non-finite-values">normalize non-finite values</a><span>, in §3.2</span> <li><a href="#dom-caretposition-offset">offset</a><span>, in §5.1</span> <li><a href="#dom-htmlelement-offsetheight">offsetHeight</a><span>, in §7</span> <li><a href="#dom-htmlelement-offsetleft">offsetLeft</a><span>, in §7</span> <li><a href="#dom-caretposition-offsetnode">offsetNode</a><span>, in §5.1</span> <li><a href="#dom-htmlelement-offsetparent">offsetParent</a><span>, in §7</span> <li><a href="#dom-htmlelement-offsettop">offsetTop</a><span>, in §7</span> <li><a href="#dom-htmlelement-offsetwidth">offsetWidth</a><span>, in §7</span> <li><a href="#dom-mouseevent-offsetx">offsetX</a><span>, in §10</span> <li><a href="#dom-mouseevent-offsety">offsetY</a><span>, in §10</span> <li><a href="#dom-mediaquerylist-onchange">onchange</a><span>, in §4.2</span> <li><a href="#dom-window-outerheight">outerHeight</a><span>, in §4</span> <li><a href="#dom-window-outerwidth">outerWidth</a><span>, in §4</span> <li><a href="#overflow-directions">overflow directions</a><span>, in §2</span> <li><a href="#dom-cssboxtype-padding">"padding"</a><span>, in §11.1</span> <li><a href="#padding-edge">padding edge</a><span>, in §2</span> <li><a href="#dom-mouseevent-pagex">pageX</a><span>, in §10</span> <li><a href="#dom-window-pagexoffset">pageXOffset</a><span>, in §4</span> <li><a href="#dom-mouseevent-pagey">pageY</a><span>, in §10</span> <li><a href="#dom-window-pageyoffset">pageYOffset</a><span>, in §4</span> <li><a href="#page-zoom">page zoom</a><span>, in §2.2</span> <li><a href="#pending-scroll-event-targets">pending scroll event targets</a><span>, in §12.2</span> <li><a href="#perform-a-scroll">perform a scroll</a><span>, in §3.1</span> <li><a href="#pinch-zoom">pinch zoom</a><span>, in §2.2</span> <li><a href="#dom-screen-pixeldepth">pixelDepth</a><span>, in §4.3</span> <li><a href="#potentially-scrollable">potentially scrollable</a><span>, in §2</span> <li><a href="#dom-boxquadoptions-relativeto">relativeTo</a><span>, in §11.1</span> <li><a href="#dom-mediaquerylist-removelistener">removeListener(listener)</a><span>, in §4.2</span> <li><a href="#eventdef-window-resize">resize</a><span>, in §12.3</span> <li><a href="#dom-window-resizeby">resizeBy(x, y)</a><span>, in §4</span> <li><a href="#dom-window-resizeto">resizeTo(x, y)</a><span>, in §4</span> <li><a href="#run-the-resize-steps">run the resize steps</a><span>, in §12.1</span> <li><a href="#run-the-scroll-steps">run the scroll steps</a><span>, in §12.2</span> <li><a href="#dom-window-screen">screen</a><span>, in §4</span> <li><a href="#screen">Screen</a><span>, in §4.3</span> <li> screenX <ul> <li><a href="#dom-window-screenx">attribute for Window</a><span>, in §4</span> <li><a href="#dom-mouseeventinit-screenx">dict-member for MouseEventInit</a><span>, in §10</span> <li><a href="#dom-mouseevent-screenx">attribute for MouseEvent</a><span>, in §10</span> </ul> <li> screenY <ul> <li><a href="#dom-window-screeny">attribute for Window</a><span>, in §4</span> <li><a href="#dom-mouseeventinit-screeny">dict-member for MouseEventInit</a><span>, in §10</span> <li><a href="#dom-mouseevent-screeny">attribute for MouseEvent</a><span>, in §10</span> </ul> <li><a href="#eventdef-document-scroll">scroll</a><span>, in §12.3</span> <li><a href="#scroll-an-element">scroll an element</a><span>, in §6.1</span> <li><a href="#scroll-an-element-into-view">scroll an element into view</a><span>, in §6.1</span> <li><a href="#propdef-scroll-behavior">scroll-behavior</a><span>, in §13.1</span> <li><a href="#enumdef-scrollbehavior">ScrollBehavior</a><span>, in §4</span> <li> scrollBy(options) <ul> <li><a href="#dom-window-scrollby">method for Window</a><span>, in §4</span> <li><a href="#dom-element-scrollby">method for Element</a><span>, in §6</span> </ul> <li> scrollBy(x, y) <ul> <li><a href="#dom-window-scrollby">method for Window</a><span>, in §4</span> <li><a href="#dom-element-scrollby">method for Element</a><span>, in §6</span> </ul> <li><a href="#dom-element-scrollheight">scrollHeight</a><span>, in §6</span> <li><a href="#scrolling-area">scrolling area</a><span>, in §2</span> <li><a href="#scrolling-area-origin">scrolling area origin</a><span>, in §2</span> <li><a href="#scrolling-box">scrolling box</a><span>, in §2</span> <li><a href="#dom-document-scrollingelement">scrollingElement</a><span>, in §5</span> <li><a href="#dom-element-scrollintoview">scrollIntoView(arg)</a><span>, in §6</span> <li><a href="#dictdef-scrollintoviewoptions">ScrollIntoViewOptions</a><span>, in §6</span> <li><a href="#dom-element-scrollleft">scrollLeft</a><span>, in §6</span> <li><a href="#enumdef-scrolllogicalposition">ScrollLogicalPosition</a><span>, in §6</span> <li> scroll(options) <ul> <li><a href="#dom-window-scroll">method for Window</a><span>, in §4</span> <li><a href="#dom-element-scroll">method for Element</a><span>, in §6</span> </ul> <li><a href="#dictdef-scrolloptions">ScrollOptions</a><span>, in §4</span> <li> scrollTo(options) <ul> <li><a href="#dom-window-scrollto">method for Window</a><span>, in §4</span> <li><a href="#dom-element-scrollto">method for Element</a><span>, in §6</span> </ul> <li><a href="#dictdef-scrolltooptions">ScrollToOptions</a><span>, in §4</span> <li><a href="#dom-element-scrolltop">scrollTop</a><span>, in §6</span> <li><a href="#scroll-to-the-beginning-of-the-document">scroll to the beginning of the document</a><span>, in §3.1</span> <li> scrollTo(x, y) <ul> <li><a href="#dom-window-scrollto">method for Window</a><span>, in §4</span> <li><a href="#dom-element-scrollto">method for Element</a><span>, in §6</span> </ul> <li><a href="#dom-element-scrollwidth">scrollWidth</a><span>, in §6</span> <li><a href="#dom-window-scrollx">scrollX</a><span>, in §4</span> <li> scroll(x, y) <ul> <li><a href="#dom-window-scroll">method for Window</a><span>, in §4</span> <li><a href="#dom-element-scroll">method for Element</a><span>, in §6</span> </ul> <li><a href="#dom-window-scrolly">scrollY</a><span>, in §4</span> <li><a href="#dom-scrollbehavior-smooth">"smooth"</a><span>, in §4</span> <li><a href="#valdef-scroll-behavior-smooth">smooth</a><span>, in §13.1</span> <li><a href="#concept-smooth-scroll">smooth scroll</a><span>, in §3.1</span> <li><a href="#smooth-scroll-aborted">smooth scroll aborted</a><span>, in §3.1</span> <li><a href="#smooth-scroll-completed">smooth scroll completed</a><span>, in §3.1</span> <li><a href="#dom-scrolllogicalposition-start">"start"</a><span>, in §6</span> <li><a href="#supported-open-feature-name">supported open() feature name</a><span>, in §4.1</span> <li><a href="#svg-layout-box">SVG layout box</a><span>, in §2</span> <li><a href="#the-html-body-element">The HTML body element</a><span>, in §2</span> <li><a href="#dom-convertcoordinateoptions-tobox">toBox</a><span>, in §11.1</span> <li> top <ul> <li><a href="#dom-scrolltooptions-top">dict-member for ScrollToOptions</a><span>, in §4</span> <li><a href="#supported-open-feature-name-top">dfn for supported open() feature name</a><span>, in §4.1</span> </ul> <li><a href="#transforms">transforms</a><span>, in §2</span> <li><a href="#viewport">viewport</a><span>, in §2</span> <li> width <ul> <li><a href="#supported-open-feature-name-width">dfn for supported open() feature name</a><span>, in §4.1</span> <li><a href="#dom-screen-width">attribute for Screen</a><span>, in §4.3</span> </ul> <li> x <ul> <li><a href="#dom-htmlimageelement-x">attribute for HTMLImageElement</a><span>, in §8</span> <li><a href="#dom-mouseevent-x">attribute for MouseEvent</a><span>, in §10</span> </ul> <li> y <ul> <li><a href="#dom-htmlimageelement-y">attribute for HTMLImageElement</a><span>, in §8</span> <li><a href="#dom-mouseevent-y">attribute for MouseEvent</a><span>, in §10</span> </ul> </ul> <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3> <ul class="index"> <li> <a data-link-type="biblio" href="#biblio-css-backgrounds-3">[css-backgrounds-3]</a> defines the following terms: <ul> <li><a href="https://www.w3.org/TR/css3-background/#border-left-width">border-left-width</a> <li><a href="https://www.w3.org/TR/css3-background/#border-top-width">border-top-width</a> </ul> <li> <a data-link-type="biblio" href="#biblio-css-break-3">[css-break-3]</a> defines the following terms: <ul> <li><a href="https://www.w3.org/TR/css3-break/#box-fragment">box fragment</a> </ul> <li> <a data-link-type="biblio" href="#biblio-css-display-3">[css-display-3]</a> defines the following terms: <ul> <li><a href="https://www.w3.org/TR/css-display-3/#initial-containing-block">initial containing block</a> <li><a href="https://www.w3.org/TR/css-display-3/#valdef-display-inline-table">inline-table</a> <li><a href="https://www.w3.org/TR/css-display-3/#valdef-display-table">table</a> <li><a href="https://www.w3.org/TR/css-display-3/#valdef-display-table-column">table-column</a> <li><a href="https://www.w3.org/TR/css-display-3/#valdef-display-table-column-group">table-column-group</a> </ul> <li> <a data-link-type="biblio" href="#biblio-css-overflow-4">[css-overflow-4]</a> defines the following terms: <ul> <li><a href="https://drafts.csswg.org/css-overflow-4/#valdef-overflow-auto">auto</a> <li><a href="https://drafts.csswg.org/css-overflow-4/#valdef-overflow-hidden">hidden</a> <li><a href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow">overflow</a> <li><a href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow-x">overflow-x</a> <li><a href="https://drafts.csswg.org/css-overflow-4/#propdef-overflow-y">overflow-y</a> <li><a href="https://drafts.csswg.org/css-overflow-4/#valdef-overflow-visible">visible</a> </ul> <li> <a data-link-type="biblio" href="#biblio-css-position-3">[css-position-3]</a> defines the following terms: <ul> <li><a href="https://www.w3.org/TR/css3-positioning/#valdef-position-positionfake-maybe-placeholderfixed-fake-maybe-placeholder">fixed</a> <li><a href="https://www.w3.org/TR/css3-positioning/#propdef-position">position</a> <li><a href="https://www.w3.org/TR/css3-positioning/#valdef-position-positionfake-maybe-placeholderstatic-fake-maybe-placeholder">static</a> </ul> <li> <a data-link-type="biblio" href="#biblio-css-pseudo-4">[css-pseudo-4]</a> defines the following terms: <ul> <li><a href="https://www.w3.org/TR/css-pseudo-4/#csspseudoelement">CSSPseudoElement</a> </ul> <li> <a data-link-type="biblio" href="#biblio-css-values">[css-values]</a> defines the following terms: <ul> <li><a href="https://www.w3.org/TR/css3-values/#comb-one">|</a> </ul> <li> <a data-link-type="biblio" href="#biblio-css-writing-modes-3">[css-writing-modes-3]</a> defines the following terms: <ul> <li><a href="https://www.w3.org/TR/css-writing-modes-3/#block-flow-direction">block flow direction</a> <li><a href="https://www.w3.org/TR/css-writing-modes-3/#inline-base-direction">inline base direction</a> </ul> <li> <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> defines the following terms: <ul> <li><a href="https://www.w3.org/TR/CSS21/visuren.html#propdef-display">display</a> </ul> <li> <a data-link-type="biblio" href="#biblio-whatwg-dom">[WHATWG-DOM]</a> defines the following terms: <ul> <li><a href="https://dom.spec.whatwg.org/#document">Document</a> <li><a href="https://dom.spec.whatwg.org/#element">Element</a> <li><a href="https://dom.spec.whatwg.org/#event">Event</a> <li><a href="https://dom.spec.whatwg.org/#dictdef-eventinit">EventInit</a> <li><a href="https://dom.spec.whatwg.org/#callbackdef-eventlistener">EventListener</a> <li><a href="https://dom.spec.whatwg.org/#eventtarget">EventTarget</a> <li><a href="https://dom.spec.whatwg.org/#node">Node</a> <li><a href="https://dom.spec.whatwg.org/#range">Range</a> <li><a href="https://dom.spec.whatwg.org/#text">Text</a> <li><a href="https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener">addEventListener(type, callback)</a> <li><a href="https://dom.spec.whatwg.org/#case-sensitive">case-sensitive</a> <li><a href="https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener">removeEventListener(type, callback, options)</a> </ul> <li> <a data-link-type="biblio" href="#biblio-geometry-1">[geometry-1]</a> defines the following terms: <ul> <li><a href="https://www.w3.org/TR/geometry-1/#dom-dompoint">DOMPoint</a> <li><a href="https://www.w3.org/TR/geometry-1/#dictdef-dompointinit">DOMPointInit</a> <li><a href="https://www.w3.org/TR/geometry-1/#dom-domquad">DOMQuad</a> <li><a href="https://drafts.fxtf.org/geometry-1/#dictdef-domquadinit">DOMQuadInit</a> <li><a href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a> <li><a href="https://www.w3.org/TR/geometry-1/#dom-domrectreadonly">DOMRectReadOnly</a> <li><a href="https://drafts.fxtf.org/geometry-1/#dom-domrect-height">height</a> <li><a href="https://drafts.fxtf.org/geometry-1/#dom-domrect-width">width</a> <li><a href="https://drafts.fxtf.org/geometry-1/#dom-domrect-x">x</a> <li><a href="https://drafts.fxtf.org/geometry-1/#dom-domrect-y">y</a> </ul> <li> <a data-link-type="biblio" href="#biblio-html">[HTML]</a> defines the following terms: <ul> <li><a href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler">EventHandler</a> <li><a href="https://html.spec.whatwg.org/multipage/dom.html#htmlelement">HTMLElement</a> <li><a href="https://html.spec.whatwg.org/multipage/embedded-content.html#htmlimageelement">HTMLImageElement</a> <li><a href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a> <li><a href="https://html.spec.whatwg.org/multipage/browsers.html#dom-document-defaultview">defaultView</a> <li><a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop">event loops</a> <li><a href="https://html.spec.whatwg.org/multipage/browsers.html#dom-open">open()</a> </ul> <li> <a data-link-type="biblio" href="#biblio-svg2">[SVG2]</a> defines the following terms: <ul> <li><a href="https://www.w3.org/TR/svg2/interact.html#PointerEventsProperty">pointer-events</a> </ul> </ul> <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2> <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3> <dl> <dt id="biblio-css-backgrounds-3">[CSS-BACKGROUNDS-3] <dd>CSS Backgrounds and Borders Module Level 3 URL: <a href="https://drafts.csswg.org/css-backgrounds-3/">https://drafts.csswg.org/css-backgrounds-3/</a> <dt id="biblio-css-break-3">[CSS-BREAK-3] <dd>Rossen Atanassov; Elika Etemad. <a href="http://dev.w3.org/csswg/css-break/">CSS Fragmentation Module Level 3</a>. 14 January 2016. CR. URL: <a href="http://dev.w3.org/csswg/css-break/">http://dev.w3.org/csswg/css-break/</a> <dt id="biblio-css-device-adapt">[CSS-DEVICE-ADAPT] <dd>Rune Lillesveen; Florian Rivoal; Matt Rakow. <a href="https://www.w3.org/TR/css-device-adapt-1/">CSS Device Adaptation Module Level 1</a>. 26 November 2015. WD. URL: <a href="https://www.w3.org/TR/css-device-adapt-1/">http://www.w3.org/TR/css-device-adapt-1/</a> <dt id="biblio-css-display-3">[CSS-DISPLAY-3] <dd>Tab Atkins Jr.; Elika Etemad. <a href="http://dev.w3.org/csswg/css-display/">CSS Display Module Level 3</a>. 15 October 2015. WD. URL: <a href="http://dev.w3.org/csswg/css-display/">http://dev.w3.org/csswg/css-display/</a> <dt id="biblio-css-overflow-4">[CSS-OVERFLOW-4] <dd>CSS Overflow Module Level 4 URL: <a href="https://drafts.csswg.org/css-overflow-4/">https://drafts.csswg.org/css-overflow-4/</a> <dt id="biblio-css-position-3">[CSS-POSITION-3] <dd>CSS Positioned Layout Module Level 3 URL: <a href="https://drafts.csswg.org/css-position-3/">https://drafts.csswg.org/css-position-3/</a> <dt id="biblio-css-pseudo-4">[CSS-PSEUDO-4] <dd>Daniel Glazman; Elika Etemad; Alan Stearns. <a href="http://dev.w3.org/csswg/css-pseudo-4/">CSS Pseudo-Elements Module Level 4</a>. 15 January 2015. WD. URL: <a href="http://dev.w3.org/csswg/css-pseudo-4/">http://dev.w3.org/csswg/css-pseudo-4/</a> <dt id="biblio-css-transforms-1">[CSS-TRANSFORMS-1] <dd>Simon Fraser; et al. <a href="https://www.w3.org/TR/css-transforms-1/">CSS Transforms Module Level 1</a>. 26 November 2013. WD. URL: <a href="https://www.w3.org/TR/css-transforms-1/">http://www.w3.org/TR/css-transforms-1/</a> <dt id="biblio-css-values">[CSS-VALUES] <dd>Tab Atkins Jr.; Elika Etemad. <a href="http://dev.w3.org/csswg/css-values/">CSS Values and Units Module Level 3</a>. 11 June 2015. CR. URL: <a href="http://dev.w3.org/csswg/css-values/">http://dev.w3.org/csswg/css-values/</a> <dt id="biblio-css-writing-modes-3">[CSS-WRITING-MODES-3] <dd>Elika Etemad; Koji Ishii. <a href="http://dev.w3.org/csswg/css-writing-modes-3/">CSS Writing Modes Level 3</a>. 15 December 2015. CR. URL: <a href="http://dev.w3.org/csswg/css-writing-modes-3/">http://dev.w3.org/csswg/css-writing-modes-3/</a> <dt id="biblio-css21">[CSS21] <dd>Bert Bos; et al. <a href="https://www.w3.org/TR/CSS2">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. REC. URL: <a href="https://www.w3.org/TR/CSS2">http://www.w3.org/TR/CSS2</a> <dt id="biblio-css3-box">[CSS3-BOX] <dd>Bert Bos. <a href="https://www.w3.org/TR/css3-box">CSS basic box model</a>. 9 August 2007. WD. URL: <a href="https://www.w3.org/TR/css3-box">http://www.w3.org/TR/css3-box</a> <dt id="biblio-cssom">[CSSOM] <dd>Simon Pieters; Glenn Adams. <a href="https://www.w3.org/TR/cssom/">CSS Object Model (CSSOM)</a>. 5 December 2013. WD. URL: <a href="https://www.w3.org/TR/cssom/">http://www.w3.org/TR/cssom/</a> <dt id="biblio-geometry-1">[GEOMETRY-1] <dd>Simon Pieters; Dirk Schulze; Rik Cabanier. <a href="http://dev.w3.org/fxtf/geometry/">Geometry Interfaces Module Level 1</a>. 25 November 2014. CR. URL: <a href="http://dev.w3.org/fxtf/geometry/">http://dev.w3.org/fxtf/geometry/</a> <dt id="biblio-html">[HTML] <dd>Ian Hickson. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a> <dt id="biblio-rfc2119">[RFC2119] <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a> <dt id="biblio-svg">[SVG] <dd>Jon Ferraiolo. <a href="https://www.w3.org/TR/SVG/">Scalable Vector Graphics (SVG) 1.0 Specification</a>. 4 September 2001. REC. URL: <a href="https://www.w3.org/TR/SVG/">http://www.w3.org/TR/SVG/</a> <dt id="biblio-webidl">[WebIDL] <dd>Cameron McCormack; Boris Zbarsky. <a href="https://www.w3.org/TR/WebIDL-1/">WebIDL Level 1</a>. 8 March 2016. CR. URL: <a href="https://www.w3.org/TR/WebIDL-1/">http://www.w3.org/TR/WebIDL-1/</a> <dt id="biblio-whatwg-dom">[WHATWG-DOM] <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a> </dl> <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3> <dl> <dt id="biblio-svg2">[SVG2] <dd>Nikos Andronikos; et al. <a href="https://www.w3.org/TR/SVG2/">Scalable Vector Graphics (SVG) 2</a>. 15 September 2015. WD. URL: <a href="https://www.w3.org/TR/SVG2/">http://www.w3.org/TR/SVG2/</a> </dl> <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2> <div class="big-element-wrapper"> <table class="index"> <thead> <tr> <th scope="col">Name <th scope="col">Value <th scope="col">Initial <th scope="col">Applies to <th scope="col">Inh. <th scope="col">%ages <th scope="col">Media <th scope="col">Animatable <th scope="col">Canonical order <th scope="col">Computed value <tbody> <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-scroll-behavior">scroll-behavior</a> <td>auto | smooth <td>auto <td>scrolling boxes <td>no <td>n/a <td>visual <td>no <td>per grammar <td>specified value </table> </div> <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2> <pre class="idl def">enum <a href="#enumdef-scrollbehavior">ScrollBehavior</a> { <a href="#dom-scrollbehavior-auto">"auto"</a>, <a href="#dom-scrollbehavior-instant">"instant"</a>, <a href="#dom-scrollbehavior-smooth">"smooth"</a> }; dictionary <a href="#dictdef-scrolloptions">ScrollOptions</a> { <a data-link-type="idl-name" href="#enumdef-scrollbehavior">ScrollBehavior</a> <a data-default=""auto"" data-type="ScrollBehavior " href="#dom-scrolloptions-behavior">behavior</a> = "auto"; }; dictionary <a href="#dictdef-scrolltooptions">ScrollToOptions</a> : <a data-link-type="idl-name" href="#dictdef-scrolloptions">ScrollOptions</a> { unrestricted double <a data-type="unrestricted double " href="#dom-scrolltooptions-left">left</a>; unrestricted double <a data-type="unrestricted double " href="#dom-scrolltooptions-top">top</a>; }; partial interface <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a> { [NewObject] <a data-link-type="idl-name" href="#mediaquerylist">MediaQueryList</a> <a class="idl-code" data-link-type="method" href="#dom-window-matchmedia">matchMedia</a>(DOMString <a href="#dom-window-matchmedia-query-query">query</a>); [SameObject, Replaceable] readonly attribute <a data-link-type="idl-name" href="#screen">Screen</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Screen " href="#dom-window-screen">screen</a>; // browsing context void <a class="idl-code" data-link-type="method" href="#dom-window-moveto">moveTo</a>(long <a href="#dom-window-moveto-x-y-x">x</a>, long <a href="#dom-window-moveto-x-y-y">y</a>); void <a class="idl-code" data-link-type="method" href="#dom-window-moveby">moveBy</a>(long <a href="#dom-window-moveby-x-y-x">x</a>, long <a href="#dom-window-moveby-x-y-y">y</a>); void <a class="idl-code" data-link-type="method" href="#dom-window-resizeto">resizeTo</a>(long <a href="#dom-window-resizeto-x-y-x">x</a>, long <a href="#dom-window-resizeto-x-y-y">y</a>); void <a class="idl-code" data-link-type="method" href="#dom-window-resizeby">resizeBy</a>(long <a href="#dom-window-resizeby-x-y-x">x</a>, long <a href="#dom-window-resizeby-x-y-y">y</a>); // viewport [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-innerwidth">innerWidth</a>; [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-innerheight">innerHeight</a>; // viewport scrolling [Replaceable] readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-window-scrollx">scrollX</a>; [Replaceable] readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-window-pagexoffset">pageXOffset</a>; [Replaceable] readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-window-scrolly">scrollY</a>; [Replaceable] readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-window-pageyoffset">pageYOffset</a>; void <a class="idl-code" data-link-type="method" href="#dom-window-scroll">scroll</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions">ScrollToOptions</a> <a href="#dom-window-scroll-options-options">options</a>); void <a class="idl-code" data-link-type="method" href="#dom-window-scroll">scroll</a>(unrestricted double <a href="#dom-window-scroll-x-y-x">x</a>, unrestricted double <a href="#dom-window-scroll-x-y-y">y</a>); void <a class="idl-code" data-link-type="method" href="#dom-window-scrollto">scrollTo</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions">ScrollToOptions</a> <a href="#dom-window-scrollto-options-options">options</a>); void <a class="idl-code" data-link-type="method" href="#dom-window-scrollto">scrollTo</a>(unrestricted double <a href="#dom-window-scrollto-x-y-x">x</a>, unrestricted double <a href="#dom-window-scrollto-x-y-y">y</a>); void <a class="idl-code" data-link-type="method" href="#dom-window-scrollby">scrollBy</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions">ScrollToOptions</a> <a href="#dom-window-scrollby-options-options">options</a>); void <a class="idl-code" data-link-type="method" href="#dom-window-scrollby">scrollBy</a>(unrestricted double <a href="#dom-window-scrollby-x-y-x">x</a>, unrestricted double <a href="#dom-window-scrollby-x-y-y">y</a>); // client [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-screenx">screenX</a>; [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-screeny">screenY</a>; [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-outerwidth">outerWidth</a>; [Replaceable] readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-window-outerheight">outerHeight</a>; [Replaceable] readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-window-devicepixelratio">devicePixelRatio</a>; }; interface <a href="#mediaquerylist">MediaQueryList</a> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget">EventTarget</a> { readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-mediaquerylist-media">media</a>; readonly attribute boolean <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="boolean " href="#dom-mediaquerylist-matches">matches</a>; void <a class="idl-code" data-link-type="method" href="#dom-mediaquerylist-addlistener">addListener</a>(<a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#callbackdef-eventlistener">EventListener</a>? <a href="#dom-mediaquerylist-addlistener-listener-listener">listener</a>); void <a class="idl-code" data-link-type="method" href="#dom-mediaquerylist-removelistener">removeListener</a>(<a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#callbackdef-eventlistener">EventListener</a>? <a href="#dom-mediaquerylist-removelistener-listener-listener">listener</a>); attribute <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler">EventHandler</a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler " href="#dom-mediaquerylist-onchange">onchange</a>; }; [<a href="#dom-mediaquerylistevent-mediaquerylistevent">Constructor</a>(DOMString <a href="#dom-mediaquerylistevent-mediaquerylistevent-type-eventinitdict-type">type</a>, optional <a data-link-type="idl-name" href="#dictdef-mediaquerylisteventinit">MediaQueryListEventInit</a> <a href="#dom-mediaquerylistevent-mediaquerylistevent-type-eventinitdict-eventinitdict">eventInitDict</a>)] interface <a href="#mediaquerylistevent">MediaQueryListEvent</a> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event">Event</a> { readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-mediaquerylistevent-media">media</a>; readonly attribute boolean <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="boolean " href="#dom-mediaquerylistevent-matches">matches</a>; }; dictionary <a href="#dictdef-mediaquerylisteventinit">MediaQueryListEventInit</a> : <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit">EventInit</a> { DOMString <a data-default="""" data-type="DOMString " href="#dom-mediaquerylisteventinit-media">media</a> = ""; boolean <a data-default="false" data-type="boolean " href="#dom-mediaquerylisteventinit-matches">matches</a> = false; }; interface <a href="#screen">Screen</a> { readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-screen-availwidth">availWidth</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-screen-availheight">availHeight</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-screen-width">width</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-screen-height">height</a>; readonly attribute unsigned long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long " href="#dom-screen-colordepth">colorDepth</a>; readonly attribute unsigned long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long " href="#dom-screen-pixeldepth">pixelDepth</a>; }; partial interface <a class="idl-code" data-link-type="interface" href="https://dom.spec.whatwg.org/#document">Document</a> { <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a>? <a class="idl-code" data-link-type="method" href="#dom-document-elementfrompoint">elementFromPoint</a>(double <a href="#dom-document-elementfrompoint-x-y-x">x</a>, double <a href="#dom-document-elementfrompoint-x-y-y">y</a>); sequence<<a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a>> <a class="idl-code" data-link-type="method" href="#dom-document-elementsfrompoint">elementsFromPoint</a>(double <a href="#dom-document-elementsfrompoint-x-y-x">x</a>, double <a href="#dom-document-elementsfrompoint-x-y-y">y</a>); <a data-link-type="idl-name" href="#caretposition">CaretPosition</a>? <a class="idl-code" data-link-type="method" href="#dom-document-caretpositionfrompoint">caretPositionFromPoint</a>(double <a href="#dom-document-caretpositionfrompoint-x-y-x">x</a>, double <a href="#dom-document-caretpositionfrompoint-x-y-y">y</a>); readonly attribute <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Element? " href="#dom-document-scrollingelement">scrollingElement</a>; }; interface <a href="#caretposition">CaretPosition</a> { readonly attribute <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#node">Node</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Node " href="#dom-caretposition-offsetnode">offsetNode</a>; readonly attribute unsigned long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long " href="#dom-caretposition-offset">offset</a>; [NewObject] <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a>? <a class="idl-code" data-link-type="method" href="#dom-caretposition-getclientrect">getClientRect</a>(); }; enum <a href="#enumdef-scrolllogicalposition">ScrollLogicalPosition</a> { <a href="#dom-scrolllogicalposition-start">"start"</a>, <a href="#dom-scrolllogicalposition-center">"center"</a>, <a href="#dom-scrolllogicalposition-end">"end"</a>, <a href="#dom-scrolllogicalposition-nearest">"nearest"</a> }; dictionary <a href="#dictdef-scrollintoviewoptions">ScrollIntoViewOptions</a> : <a data-link-type="idl-name" href="#dictdef-scrolloptions">ScrollOptions</a> { <a data-link-type="idl-name" href="#enumdef-scrolllogicalposition">ScrollLogicalPosition</a> <a data-default=""center"" data-type="ScrollLogicalPosition " href="#dom-scrollintoviewoptions-block">block</a> = "center"; <a data-link-type="idl-name" href="#enumdef-scrolllogicalposition">ScrollLogicalPosition</a> <a data-default=""center"" data-type="ScrollLogicalPosition " href="#dom-scrollintoviewoptions-inline">inline</a> = "center"; }; partial interface <a class="idl-code" data-link-type="interface" href="https://dom.spec.whatwg.org/#element">Element</a> { sequence<<a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a>> <a class="idl-code" data-link-type="method" href="#dom-element-getclientrects">getClientRects</a>(); [NewObject] <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a> <a class="idl-code" data-link-type="method" href="#dom-element-getboundingclientrect">getBoundingClientRect</a>(); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollintoview">scrollIntoView</a>(); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollintoview">scrollIntoView</a>((boolean or object) <a href="#dom-element-scrollintoview-arg-arg">arg</a>); void <a class="idl-code" data-link-type="method" href="#dom-element-scroll">scroll</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions">ScrollToOptions</a> <a href="#dom-element-scroll-options-options">options</a>); void <a class="idl-code" data-link-type="method" href="#dom-element-scroll">scroll</a>(unrestricted double <a href="#dom-element-scroll-x-y-x">x</a>, unrestricted double <a href="#dom-element-scroll-x-y-y">y</a>); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollto">scrollTo</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions">ScrollToOptions</a> <a href="#dom-element-scrollto-options-options">options</a>); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollto">scrollTo</a>(unrestricted double <a href="#dom-element-scrollto-x-y-x">x</a>, unrestricted double <a href="#dom-element-scrollto-x-y-y">y</a>); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollby">scrollBy</a>(optional <a data-link-type="idl-name" href="#dictdef-scrolltooptions">ScrollToOptions</a> <a href="#dom-element-scrollby-options-options">options</a>); void <a class="idl-code" data-link-type="method" href="#dom-element-scrollby">scrollBy</a>(unrestricted double <a href="#dom-element-scrollby-x-y-x">x</a>, unrestricted double <a href="#dom-element-scrollby-x-y-y">y</a>); attribute unrestricted double <a class="idl-code" data-link-type="attribute" data-type="unrestricted double " href="#dom-element-scrolltop">scrollTop</a>; attribute unrestricted double <a class="idl-code" data-link-type="attribute" data-type="unrestricted double " href="#dom-element-scrollleft">scrollLeft</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-scrollwidth">scrollWidth</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-scrollheight">scrollHeight</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-clienttop">clientTop</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-clientleft">clientLeft</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-clientwidth">clientWidth</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-element-clientheight">clientHeight</a>; }; partial interface <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/dom.html#htmlelement">HTMLElement</a> { readonly attribute <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Element? " href="#dom-htmlelement-offsetparent">offsetParent</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlelement-offsettop">offsetTop</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlelement-offsetleft">offsetLeft</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlelement-offsetwidth">offsetWidth</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlelement-offsetheight">offsetHeight</a>; }; partial interface <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/embedded-content.html#htmlimageelement">HTMLImageElement</a> { readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlimageelement-x">x</a>; readonly attribute long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="long " href="#dom-htmlimageelement-y">y</a>; }; partial interface <a class="idl-code" data-link-type="interface" href="https://dom.spec.whatwg.org/#range">Range</a> { sequence<<a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a>> <a class="idl-code" data-link-type="method" href="#dom-range-getclientrects">getClientRects</a>(); [NewObject] <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrect">DOMRect</a> <a class="idl-code" data-link-type="method" href="#dom-range-getboundingclientrect">getBoundingClientRect</a>(); }; partial interface <a class="idl-code" data-link-type="interface" href="https://www.w3.org/TR/DOM-Level-3-Events/#interface-MouseEvent">MouseEvent</a> { readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-screenx">screenX</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-screeny">screenY</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-pagex">pageX</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-pagey">pageY</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-clientx">clientX</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-clienty">clientY</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-x">x</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-y">y</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-offsetx">offsetX</a>; readonly attribute double <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="double " href="#dom-mouseevent-offsety">offsetY</a>; }; partial dictionary <a href="#dictdef-mouseeventinit">MouseEventInit</a> { double <a data-default="0.0" data-type="double " href="#dom-mouseeventinit-screenx">screenX</a> = 0.0; double <a data-default="0.0" data-type="double " href="#dom-mouseeventinit-screeny">screenY</a> = 0.0; double <a data-default="0.0" data-type="double " href="#dom-mouseeventinit-clientx">clientX</a> = 0.0; double <a data-default="0.0" data-type="double " href="#dom-mouseeventinit-clienty">clientY</a> = 0.0; }; enum <a href="#enumdef-cssboxtype">CSSBoxType</a> { <a href="#dom-cssboxtype-margin">"margin"</a>, <a href="#dom-cssboxtype-border">"border"</a>, <a href="#dom-cssboxtype-padding">"padding"</a>, <a href="#dom-cssboxtype-content">"content"</a> }; dictionary <a href="#dictdef-boxquadoptions">BoxQuadOptions</a> { <a data-link-type="idl-name" href="#enumdef-cssboxtype">CSSBoxType</a> <a data-default=""border"" data-type="CSSBoxType " href="#dom-boxquadoptions-box">box</a> = "border"; <a data-link-type="idl-name" href="#typedefdef-geometrynode">GeometryNode</a> <a data-type="GeometryNode " href="#dom-boxquadoptions-relativeto">relativeTo</a>; // XXX default document (i.e. viewport) }; dictionary <a href="#dictdef-convertcoordinateoptions">ConvertCoordinateOptions</a> { <a data-link-type="idl-name" href="#enumdef-cssboxtype">CSSBoxType</a> <a data-default=""border"" data-type="CSSBoxType " href="#dom-convertcoordinateoptions-frombox">fromBox</a> = "border"; <a data-link-type="idl-name" href="#enumdef-cssboxtype">CSSBoxType</a> <a data-default=""border"" data-type="CSSBoxType " href="#dom-convertcoordinateoptions-tobox">toBox</a> = "border"; }; [NoInterfaceObject] interface <a href="#geometryutils">GeometryUtils</a> { sequence<<a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domquad">DOMQuad</a>> <a class="idl-code" data-link-type="method" href="#dom-geometryutils-getboxquads">getBoxQuads</a>(optional <a data-link-type="idl-name" href="#dictdef-boxquadoptions">BoxQuadOptions</a> <a href="#dom-geometryutils-getboxquads-options-options">options</a>); <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domquad">DOMQuad</a> <a class="idl-code" data-link-type="method" href="#dom-geometryutils-convertquadfromnode">convertQuadFromNode</a>(<a data-link-type="idl-name" href="https://drafts.fxtf.org/geometry-1/#dictdef-domquadinit">DOMQuadInit</a> <a href="#dom-geometryutils-convertquadfromnode-quad-from-options-quad">quad</a>, <a data-link-type="idl-name" href="#typedefdef-geometrynode">GeometryNode</a> <a href="#dom-geometryutils-convertquadfromnode-quad-from-options-from">from</a>, optional <a data-link-type="idl-name" href="#dictdef-convertcoordinateoptions">ConvertCoordinateOptions</a> <a href="#dom-geometryutils-convertquadfromnode-quad-from-options-options">options</a>); <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domquad">DOMQuad</a> <a class="idl-code" data-link-type="method" href="#dom-geometryutils-convertrectfromnode">convertRectFromNode</a>(<a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-domrectreadonly">DOMRectReadOnly</a> <a href="#dom-geometryutils-convertrectfromnode-rect-from-options-rect">rect</a>, <a data-link-type="idl-name" href="#typedefdef-geometrynode">GeometryNode</a> <a href="#dom-geometryutils-convertrectfromnode-rect-from-options-from">from</a>, optional <a data-link-type="idl-name" href="#dictdef-convertcoordinateoptions">ConvertCoordinateOptions</a> <a href="#dom-geometryutils-convertrectfromnode-rect-from-options-options">options</a>); <a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dom-dompoint">DOMPoint</a> <a class="idl-code" data-link-type="method" href="#dom-geometryutils-convertpointfromnode">convertPointFromNode</a>(<a data-link-type="idl-name" href="https://www.w3.org/TR/geometry-1/#dictdef-dompointinit">DOMPointInit</a> <a href="#dom-geometryutils-convertpointfromnode-point-from-options-point">point</a>, <a data-link-type="idl-name" href="#typedefdef-geometrynode">GeometryNode</a> <a href="#dom-geometryutils-convertpointfromnode-point-from-options-from">from</a>, optional <a data-link-type="idl-name" href="#dictdef-convertcoordinateoptions">ConvertCoordinateOptions</a> <a href="#dom-geometryutils-convertpointfromnode-point-from-options-options">options</a>); // XXX z,w turns into 0 }; <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#text">Text</a> implements <a data-link-type="idl-name" href="#geometryutils">GeometryUtils</a>; // like Range <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a> implements <a data-link-type="idl-name" href="#geometryutils">GeometryUtils</a>; <a data-link-type="idl-name" href="https://www.w3.org/TR/css-pseudo-4/#csspseudoelement">CSSPseudoElement</a> implements <a data-link-type="idl-name" href="#geometryutils">GeometryUtils</a>; <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#document">Document</a> implements <a data-link-type="idl-name" href="#geometryutils">GeometryUtils</a>; typedef (<a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#text">Text</a> or <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#element">Element</a> or <a data-link-type="idl-name" href="https://www.w3.org/TR/css-pseudo-4/#csspseudoelement">CSSPseudoElement</a> or <a data-link-type="idl-name" href="https://dom.spec.whatwg.org/#document">Document</a>) <a href="#typedefdef-geometrynode">GeometryNode</a>; </pre> <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2> <div style="counter-reset:issue"> <div class="issue">The terms <a data-link-type="dfn" href="#css-layout-box">CSS layout box</a> and <a data-link-type="dfn" href="#svg-layout-box">SVG layout box</a> are not currently defined by CSS or SVG. <a href="#issue-08afa5fa"> ↵ </a></div> <div class="issue"> The object IDL fragment redefines some members. Can we resolve this somehow?<a href="#issue-6025106e"> ↵ </a></div> <div class="issue"> DOM order <p>p1 = top left even in RTL</p> <p>scale to 0 means divide by zero, return 0x0</p> <p>cross-frames not allowed, throw WrongDocumentError?</p> <p>points are flattened (3d transform), z=0. like getClientRect</p> <p>test block in inline</p> <p>pseudo-elements before/after are children of the element</p> <p>viewport boxes are all the same</p> <a href="#issue-c925384b"> ↵ </a> </div> <div class="issue">... <a href="#issue-2f43b42f"> ↵ </a></div> <div class="issue">... <a href="#issue-2f43b42f0"> ↵ </a></div> <div class="issue">... <a href="#issue-2f43b42f1"> ↵ </a></div> <div class="issue"> The features in this section should be moved to some other specification.<a href="#issue-e12d69d6"> ↵ </a></div> </div> <script> document.body.addEventListener("click", function(e) { var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); } // Find the dfn element or panel, if any, that was clicked on. var el = e.target; var target; while(el.parentElement) { if(el.tagName == "DFN") { target = "dfn"; break; } if(/H\d/.test(el.tagName) && el.getAttribute('data-dfn-type') != null) { target = "dfn"; break; } if(el.classList.contains("dfn-panel")) { target = "dfn-panel"; break; } el = el.parentElement; } if(target != "dfn-panel") { // Turn off any currently "on" or "activated" panels. queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){ el.classList.remove("on"); el.classList.remove("activated"); }); } if(target == "dfn") { // open the panel var dfnPanel = el.querySelector(".dfn-panel"); if(dfnPanel) { dfnPanel.classList.add("on"); } } else if(target == "dfn-panel") { // Switch it to "activated" state, which pins it. el.classList.add("activated"); } }); </script>