Skip to content

Commit cb5c47f

Browse files
committed
define offsetWidth/offsetHeight and client*; still lots of things to work out
1 parent 366d349 commit cb5c47f

1 file changed

Lines changed: 38 additions & 25 deletions

File tree

cssom/Overview.src.html

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,54 +1748,67 @@ <h5><code>offsetLeft</code> and <code>offsetRight</code></h5>
17481748

17491749
<h5><code>offsetWidth</code> and <code>offsetHeight</code></h5>
17501750

1751-
<p class="issue">It seems these are reasonable consistent with
1752-
<code>offsetLeft</code> and <code>offsetRight</code>... They basically
1753-
represent the border box of an element.</p>
1751+
<p>The <dfn><code>offsetWidth</code></dfn> attribute of element <var>A</var>
1752+
<em class="ct">must</em> be the number of pixels given by the border box
1753+
width<!--XXX ref-->.</p>
1754+
1755+
<p>The <dfn><code>offsetHeight</code></dfn> attribute of element <var>A</var>
1756+
<em class="ct">must</em> be the number of pixels given by the border box
1757+
height<!--XXX ref-->.</p>
17541758

17551759
<p class="issue">In quirks mode "the body element" represents the viewport
17561760
height and width here and in standards mode that would be "the html element"
17571761
or root element.</p>
17581762

17591763
<h4>The <code>scroll<var>*</var></code> attributes</h4>
17601764

1761-
<p class="issue">...</p>
1765+
<p class="issue">It seems scrollWidth and scrollHeight are defined by the
1766+
boxes they contain plus any the surrounding padding area. How about principle
1767+
box width/height + padding edge width. For inline boxes they are identical to
1768+
offsetWidth/offsetHeight it seems.</p>
17621769

17631770
<h4>The <code>client<var>*</var></code> attributes</h4>
17641771

1765-
<p class="issue">These attributes are concerned about the "padding box"
1766-
excluding size taken up by scrollbars...</p>
1767-
<!--
1768-
The clientWidth and clientHeight of element A is the width and height of the padding box, excluding any horizontal or vertical scrollbar generated by the element.
1769-
1770-
In strict mode clientWidth and clientHeight of the root element (HTML) is the viewport (initial containing block) width and height.
1771-
1772-
In quirks mode clientWidth and clientHeight of the BODY element is the viewport (initial containing block) width and height. In quirks mode clientWidth and clientHeight of the root element (HTML) is viewport (initial containing block) width and root element padding height.
1773-
1774-
What clientWidth and clientHeight are when A is an inline box is not defined.
1772+
<p>The <dfn><code>clientTop</code></dfn> attribute of element <var>A</var>
1773+
<em class="ct">must</em> be the computed value of the
1774+
<code>border-top-width</code> property in pixels plus the width of any
1775+
scrollbar in pixels rendered between the top padding box and top border
1776+
box.</p>
17751777

1776-
-->
1778+
<p>The <dfn><code>clientLeft</code></dfn> attribute of element <var>A</var>
1779+
<em class="ct">must</em> be the computed value of the
1780+
<code>border-left-width</code> property in pixels plus the width of any
1781+
scrollbar in pixels rendered between the left padding box and left border
1782+
box.</p>
17771783

1778-
<div class="issue">
1784+
<p>The <dfn><code>clientWidth</code></dfn> attribute of element <var>A</var>
1785+
<em class="ct">must</em> be the width of the padding box (excluding the width
1786+
of any rendered scrollbar between the padding and border box).</p>
17791787

1780-
<pre>So client* 0,0 area is the top left padding edge of the element.
1788+
<p>The <dfn><code>clientHeight</code></dfn> attribute of element <var>A</var>
1789+
<em class="ct">must</em> be the height of the padding box (excluding the width
1790+
of any rendered scrollbar between the padding and border box).</p>
17811791

1782-
clientWidth for block level elments (at least) is therefore "padding-left +
1783-
width + padding-right" (scrollbar excluded) and clientHeight
1784-
padding-top + height + padding-bottom." (scrollbar excluded)
1792+
<!--
1793+
In strict mode clientWidth and clientHeight of the root element (HTML) is the
1794+
viewport (initial containing block) width and height.
17851795
1786-
width and height of the "padding box"
1796+
In quirks mode clientWidth and clientHeight of the BODY element is the
1797+
viewport (initial containing block) width and height. In quirks mode
1798+
clientWidth and clientHeight of the root element (HTML) is viewport (initial
1799+
containing block) width and root element padding height.
1800+
-->
17871801

1788-
clientTop is border-top-width. clientLeft is border-left-width. Both include the
1789-
scrollbar width if rendered at the top or at the left. This can happen when the
1790-
text direction is different from TB-LR.</pre>
1802+
<p class="issue">Need to define this for the body element and the html
1803+
element. For inline boxes client* is always 0...</p>
17911804

1805+
<div class="issue">
17921806
<p>Based on limiting testing there's an object that implements TextRangle
17931807
returned by getBoundingClientRect.</p>
17941808

17951809
<p>On block level elements TextRectangleList.length is mostly 1 (except I
17961810
guess for printing or so or multicol perhaps and for inline elements with
17971811
multiple boxes it's the amount of boxes.</p>
1798-
17991812
</div>
18001813

18011814
<h2 class="no-num">Acknowledgements</h2>

0 commit comments

Comments
 (0)