Skip to content

Commit c7eea9e

Browse files
author
Simon Pieters
committed
[cssom-view] Make clientTop, clientLeft, clientWidth, clientHeight, offsetTop, offsetLeft, offsetWidth and offsetHeight ignore transforms. https://www.w3.org/Bugs/Public/show_bug.cgi?id=15430
1 parent 16efbbd commit c7eea9e

2 files changed

Lines changed: 40 additions & 36 deletions

File tree

cssom-view/Overview.html

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ <h2 id="terminology"><span class="secno">3 </span>Terminology</h2>
417417

418418
<p>The term <dfn id="layout-box">layout box</dfn> refers to either a <a href="#css-layout-box">CSS layout box</a> or an <a href="#svg-layout-box">SVG layout box</a>.
419419

420+
<p>The term <dfn id="transforms">transforms</dfn> refers to SVG transforms and CSS transforms. <a href="#refsSVG">[SVG]</a> <a href="#refsCSSTRANSFORMS">[CSSTRANSFORMS]</a>
421+
422+
420423
<h3 id="css-pixels"><span class="secno">3.1 </span>CSS pixels</h3>
421424

422425
<p>All coordinates and dimensions for the APIs defined in this
@@ -966,8 +969,8 @@ <h3 id="the-caretposition-interface"><span class="secno">6.1 </span>The <code ti
966969
</ol>
967970
<li><p>If <a href="#caret-node">caret node</a> is a text entry widget that is a replaced element,
968971
and that is in the document, return a <code><a href="#domrect">DOMRect</a></code> object for the caret
969-
in the widget as represented by the <a href="#caret-offset">caret offset</a> value. The SVG transforms and CSS transforms that apply to the element and its ancestors are
970-
applied. <a href="#refsSVG">[SVG]</a> <a href="#refsCSSTRANSFORMS">[CSSTRANSFORMS]</a>
972+
in the widget as represented by the <a href="#caret-offset">caret offset</a> value. The <a href="#transforms">transforms</a> that apply to the element and its ancestors are
973+
applied.
971974
<li><p>Return null.
972975
</ol>
973976

@@ -1002,16 +1005,14 @@ <h2 id="extensions-to-the-element-interface"><span class="secno">7 </span>Extens
10021005
<li><p>If the element has an associated <a href="#svg-layout-box">SVG layout box</a> return a
10031006
<code><a href="#domrectlist">DOMRectList</a></code> object containing a single
10041007
<code><a href="#domrect">DOMRect</a></code> object that describes the bounding box of the
1005-
element as defined by the SVG specification, applying the SVG transforms and CSS transforms that apply to the element and its ancestors.
1006-
<a href="#refsSVG">[SVG]</a> <a href="#refsCSSTRANSFORMS">[CSSTRANSFORMS]</a></li>
1008+
element as defined by the SVG specification, applying the <a href="#transforms">transforms</a> that apply to the element and its ancestors.</li>
10071009
<li>
10081010
<p>Return a <code><a href="#domrectlist">DOMRectList</a></code> object containing a list of
10091011
<code><a href="#domrect">DOMRect</a></code> objects in content order describing the border
10101012
boxes (including those with a height or width of zero) with the
10111013
following constraints:</p>
10121014
<ul>
1013-
<li><p>Apply the SVG transforms and CSS transforms that apply to the element and its ancestors. <a href="#refsSVG">[SVG]</a>
1014-
<a href="#refsCSSTRANSFORMS">[CSSTRANSFORMS]</a>
1015+
<li><p>Apply the <a href="#transforms">transforms</a> that apply to the element and its ancestors.
10151016
<li><p>If the element on which the method was invoked has a computed
10161017
value for the 'display' property of 'table' or
10171018
'inline-table' include both the table box and the caption
@@ -1173,14 +1174,14 @@ <h2 id="extensions-to-the-element-interface"><span class="secno">7 </span>Extens
11731174
<ol>
11741175
<li><p>If the element has no associated <a href="#css-layout-box">CSS layout box</a> or if the <a href="#css-layout-box">CSS layout box</a> is inline, return zero.
11751176
<li><p>Return the computed value of the 'border-top-width' property plus the height of any scrollbar rendered between the top <a href="#padding-edge">padding
1176-
edge</a> and the top <a href="#border-edge">border edge</a>.
1177+
edge</a> and the top <a href="#border-edge">border edge</a>, ignoring any <a href="#transforms">transforms</a> that apply to the element and its ancestors.
11771178
</ol>
11781179

11791180
<p>The <dfn id="dom-element-clientleft" title="dom-Element-clientLeft"><code>clientLeft</code></dfn> attribute must run these steps:
11801181
<ol>
11811182
<li><p>If the element has no associated <a href="#css-layout-box">CSS layout box</a> or if the <a href="#css-layout-box">CSS layout box</a> is inline, return zero.
11821183
<li><p>Return the computed value of the 'border-left-width' property plus the width of any scrollbar rendered between the left <a href="#padding-edge">padding
1183-
edge</a> and the left <a href="#border-edge">border edge</a>.
1184+
edge</a> and the left <a href="#border-edge">border edge</a>, ignoring any <a href="#transforms">transforms</a> that apply to the element and its ancestors.
11841185
</ol>
11851186

11861187
<p>The <dfn id="dom-element-clientwidth" title="dom-Element-clientWidth"><code>clientWidth</code></dfn> attribute must run these steps:
@@ -1191,7 +1192,7 @@ <h2 id="extensions-to-the-element-interface"><span class="secno">7 </span>Extens
11911192
<a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, return the <a href="#viewport">viewport</a> width excluding the size of a rendered scroll bar
11921193
(if any).
11931194
<li><p>Return the width of the <a href="#padding-edge">padding edge</a> excluding the width of any rendered scrollbar between the <a href="#padding-edge">padding edge</a> and the
1194-
<a href="#border-edge">border edge</a>.
1195+
<a href="#border-edge">border edge</a>, ignoring any <a href="#transforms">transforms</a> that apply to the element and its ancestors.
11951196
</ol>
11961197

11971198
<p>The <dfn id="dom-element-clientheight" title="dom-Element-clientHeight"><code>clientHeight</code></dfn> attribute must run these steps:
@@ -1202,7 +1203,7 @@ <h2 id="extensions-to-the-element-interface"><span class="secno">7 </span>Extens
12021203
<a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, return the <a href="#viewport">viewport</a> height excluding the size of a rendered scroll
12031204
bar (if any).
12041205
<li><p>Return the height of the <a href="#padding-edge">padding edge</a> excluding the height of any rendered scrollbar between the <a href="#padding-edge">padding edge</a> and the
1205-
<a href="#border-edge">border edge</a>.
1206+
<a href="#border-edge">border edge</a>, ignoring any <a href="#transforms">transforms</a> that apply to the element and its ancestors.
12061207
</ol>
12071208

12081209
<h3 id="the-getclientrects()-and-getboundingclientrect()-methods"><span class="secno">7.1 </span>The <code title="">getClientRects()</code> and
@@ -1403,15 +1404,15 @@ <h2 id="extensions-to-the-htmlelement-interface"><span class="secno">8 </span>Ex
14031404
<li><p>If the <code title="dom-HTMLElement-offsetParent"><a href="#dom-htmlelement-offsetparent">offsetParent</a></code> of the element is null return the
14041405
y-coordinate of the top <a href="#border-edge">border edge</a> of the first
14051406
<a href="#css-layout-box">CSS layout box</a> associated with the element, relative to the
1406-
<a href="#initial-containing-block">initial containing block</a> origin, and terminate this
1407+
<a href="#initial-containing-block">initial containing block</a> origin, ignoring any <a href="#transforms">transforms</a> that apply to the element and its ancestors, and terminate this
14071408
algorithm.</li>
14081409
<li>
14091410
<p>Return the result of subtracting the y-coordinate of the top
14101411
<a href="#padding-edge">padding edge</a> of the first <a href="#css-layout-box">CSS layout box</a> associated with
14111412
the <code title="dom-HTMLElement-offsetParent"><a href="#dom-htmlelement-offsetparent">offsetParent</a></code> of the element from the y-coordinate of
14121413
the top <a href="#border-edge">border edge</a> of the first <a href="#css-layout-box">CSS layout box</a> associated
14131414
with the element, relative to the <a href="#initial-containing-block">initial containing block</a>
1414-
origin.</p>
1415+
origin, ignoring any <a href="#transforms">transforms</a> that apply to the element and its ancestors.</p>
14151416
<p class="note">An inline element that consists of multiple line boxes
14161417
will only have its first <a href="#css-layout-box">CSS layout box</a> considered.</p>
14171418
</li>
@@ -1425,28 +1426,30 @@ <h2 id="extensions-to-the-htmlelement-interface"><span class="secno">8 </span>Ex
14251426
<li><p>If the <code title="dom-HTMLElement-offsetParent"><a href="#dom-htmlelement-offsetparent">offsetParent</a></code> of the element is null return the
14261427
x-coordinate of the left <a href="#border-edge">border edge</a> of the first
14271428
<a href="#css-layout-box">CSS layout box</a> associated with the element, relative to the
1428-
<a href="#initial-containing-block">initial containing block</a> origin, and terminate this
1429+
<a href="#initial-containing-block">initial containing block</a> origin, , ignoring any <a href="#transforms">transforms</a> that apply to the element and its ancestors, and terminate this
14291430
algorithm.</li>
14301431
<li>
14311432
<p>Return the result of subtracting the x-coordinate of the left
14321433
<a href="#padding-edge">padding edge</a> of the first <a href="#css-layout-box">CSS layout box</a> associated with
14331434
the <code title="dom-HTMLElement-offsetParent"><a href="#dom-htmlelement-offsetparent">offsetParent</a></code> of the element from the x-coordinate of
14341435
the left <a href="#border-edge">border edge</a> of the first <a href="#css-layout-box">CSS layout box</a> associated
14351436
with the element, relative to the <a href="#initial-containing-block">initial containing block</a>
1436-
origin.</p>
1437+
origin, ignoring any <a href="#transforms">transforms</a> that apply to the element and its ancestors.</p>
14371438
</li>
14381439
</ol>
14391440

14401441
<p>The <dfn id="dom-htmlelement-offsetwidth" title="dom-HTMLElement-offsetWidth"><code>offsetWidth</code></dfn> attribute must return the result of running these steps:</p>
14411442
<ol>
14421443
<li><p>If the element does not have any associated <a href="#css-layout-box">CSS layout box</a> return zero and terminate this algorithm.</li>
1443-
<li><p>Return the <a href="#border-edge">border edge</a> width of the first <a href="#css-layout-box">CSS layout box</a> associated with the element.</li>
1444+
<li><p>Return the <a href="#border-edge">border edge</a> width of the first <a href="#css-layout-box">CSS layout box</a> associated with the element, ignoring any <a href="#transforms">transforms</a>
1445+
that apply to the element and its ancestors.</li>
14441446
</ol>
14451447

14461448
<p>The <dfn id="dom-htmlelement-offsetheight" title="dom-HTMLElement-offsetHeight"><code>offsetHeight</code></dfn> attribute must return the result of running these steps:</p>
14471449
<ol>
14481450
<li><p>If the element does not have any associated <a href="#css-layout-box">CSS layout box</a> return zero and terminate this algorithm.</li>
1449-
<li><p>Return the <a href="#border-edge">border edge</a> height of the first <a href="#css-layout-box">CSS layout box</a> associated with the element.</li>
1451+
<li><p>Return the <a href="#border-edge">border edge</a> height of the first <a href="#css-layout-box">CSS layout box</a> associated with the element, ignoring any <a href="#transforms">transforms</a>
1452+
that apply to the element and its ancestors.</li>
14501453
</ol>
14511454

14521455
<h2 id="extensions-to-the-range-interface"><span class="secno">9 </span>Extensions to the <code title="">Range</code> Interface</h2>
@@ -1475,8 +1478,7 @@ <h2 id="extensions-to-the-range-interface"><span class="secno">9 </span>Extensio
14751478
whole line box). The bounds of these <code><a href="#domrect">DOMRect</a></code> objects are
14761479
computed using font metrics; thus, for horizontal writing, the vertical
14771480
dimension of each box is determined by the font ascent and descent, and
1478-
the horizontal dimension by the text advance width. The SVG transforms and CSS transforms that apply to the ancestors are applied.
1479-
<a href="#refsSVG">[SVG]</a> <a href="#refsCSSTRANSFORMS">[CSSTRANSFORMS]</a></li>
1481+
the horizontal dimension by the text advance width. The <a href="#transforms">transforms</a> that apply to the ancestors are applied.
14801482
</ul>
14811483

14821484
<p>The <dfn id="dom-range-getboundingclientrect" title="dom-Range-getBoundingClientRect"><code>getBoundingClientRect()</code></dfn> method, when invoked, must return the result of the following

0 commit comments

Comments
 (0)