-<p>The <code>getBoundingClientRect</code> operation, when invoked, must return the result of the following algorithm:</p> <ol> <li><p>Let <var>list</var> be the result of invoking <code title="dom-Element-getClientRects">getClientRects()</code> on the same element this method was invoked on.</li> <li><p>If the <var>list</var> is empty return a <code>ClientRect</code> object whose <code title="dom-ClientRect-top">top</code>, <code title="dom-ClientRect-right">right</code>, <code title="dom-ClientRect-bottom">bottom</code> and <code title="dom-ClientRect-left">left</code> members are zero.</li> <li><p>Otherwise, return a <code>ClientRect</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.</li> </ol> <div class="example"> <p>The following snippet gets the dimensions of the first <code>div</code> element in a document:</p> <pre class="example"><code>var example = document.getElementsByTagName("div")[0].getBoundingClientRect();
0 commit comments