Skip to content

Commit e008267

Browse files
author
Simon Pieters
committed
[cssom-view] Make new DOMQuad(rect) use x/y/width/height instead of top/right/bottom/left (so when width/height are negative, p1 is the bottom right corner).
1 parent 35b7e65 commit e008267

2 files changed

Lines changed: 30 additions & 30 deletions

File tree

cssom-view/Overview.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,21 +1773,21 @@ <h3 class="atrisk" id="the-domquad-interface"><span class="secno">11.4 </span>Th
17731773
<li><p>If invoked with one argument, follow these substeps:
17741774
<ol>
17751775
<li><p>Let <var>rect</var> be the argument.
1776-
<li><p>Let <var>top</var>, <var>right</var>, <var>bottom</var> and <var>left</var> be <var>rect</var>'s the value of <code title="dom-DOMRect-top"><a href="#dom-domrect-top">top</a></code>,
1777-
<code title="dom-DOMRect-right"><a href="#dom-domrect-right">right</a></code>, <code title="dom-DOMRect-bottom"><a href="#dom-domrect-bottom">bottom</a></code> and <code title="dom-DOMRect-left"><a href="#dom-domrect-left">left</a></code> attributes,
1776+
<li><p>Let <var>x</var>, <var>y</var>, <var>width</var> and <var>height</var> be <var>rect</var>'s the value of <code title="dom-DOMRect-x"><a href="#dom-domrect-x">x</a></code>,
1777+
<code title="dom-DOMRect-y"><a href="#dom-domrect-y">y</a></code>, <code title="dom-DOMRect-width"><a href="#dom-domrect-width">width</a></code> and <code title="dom-DOMRect-height"><a href="#dom-domrect-height">height</a></code> attributes,
17781778
respectively.
1779-
<li><p>Let <var>point 1</var> be a new <code><a href="#dompoint">DOMPoint</a></code> object with <code title="dom-DOMPoint-x"><a href="#dom-dompoint-x">x</a></code> set to <var>left</var>,
1780-
<code title="dom-DOMPoint-y"><a href="#dom-dompoint-y">y</a></code> set to <var>top</var>, <code title="dom-DOMPoint-z"><a href="#dom-dompoint-z">z</a></code> set to zero and <code title="dom-DOMPoint-w"><a href="#dom-dompoint-w">w</a></code> set to
1779+
<li><p>Let <var>point 1</var> be a new <code><a href="#dompoint">DOMPoint</a></code> object with <code title="dom-DOMPoint-x"><a href="#dom-dompoint-x">x</a></code> set to <var>x</var>,
1780+
<code title="dom-DOMPoint-y"><a href="#dom-dompoint-y">y</a></code> set to <var>y</var>, <code title="dom-DOMPoint-z"><a href="#dom-dompoint-z">z</a></code> set to zero and <code title="dom-DOMPoint-w"><a href="#dom-dompoint-w">w</a></code> set to
17811781
one.
1782-
<li><p>Let <var>point 2</var> be a new <code><a href="#dompoint">DOMPoint</a></code> object with <code title="dom-DOMPoint-x"><a href="#dom-dompoint-x">x</a></code> set to <var>right</var>,
1783-
<code title="dom-DOMPoint-y"><a href="#dom-dompoint-y">y</a></code> set to <var>top</var>, <code title="dom-DOMPoint-z"><a href="#dom-dompoint-z">z</a></code> set to zero and <code title="dom-DOMPoint-w"><a href="#dom-dompoint-w">w</a></code> set to
1784-
one.
1785-
<li><p>Let <var>point 3</var> be a new <code><a href="#dompoint">DOMPoint</a></code> object with <code title="dom-DOMPoint-x"><a href="#dom-dompoint-x">x</a></code> set to <var>right</var>,
1786-
<code title="dom-DOMPoint-y"><a href="#dom-dompoint-y">y</a></code> set to <var>bottom</var>, <code title="dom-DOMPoint-z"><a href="#dom-dompoint-z">z</a></code> set to zero and <code title="dom-DOMPoint-w"><a href="#dom-dompoint-w">w</a></code> set to
1787-
one.
1788-
<li><p>Let <var>point 4</var> be a new <code><a href="#dompoint">DOMPoint</a></code> object with <code title="dom-DOMPoint-x"><a href="#dom-dompoint-x">x</a></code> set to <var>left</var>,
1789-
<code title="dom-DOMPoint-y"><a href="#dom-dompoint-y">y</a></code> set to <var>bottom</var>, <code title="dom-DOMPoint-z"><a href="#dom-dompoint-z">z</a></code> set to zero and <code title="dom-DOMPoint-w"><a href="#dom-dompoint-w">w</a></code> set to
1782+
<li><p>Let <var>point 2</var> be a new <code><a href="#dompoint">DOMPoint</a></code> object with <code title="dom-DOMPoint-x"><a href="#dom-dompoint-x">x</a></code> set to <var>x</var> + <var>width</var>,
1783+
<code title="dom-DOMPoint-y"><a href="#dom-dompoint-y">y</a></code> set to <var>y</var>, <code title="dom-DOMPoint-z"><a href="#dom-dompoint-z">z</a></code> set to zero and <code title="dom-DOMPoint-w"><a href="#dom-dompoint-w">w</a></code> set to
17901784
one.
1785+
<li><p>Let <var>point 3</var> be a new <code><a href="#dompoint">DOMPoint</a></code> object with <code title="dom-DOMPoint-x"><a href="#dom-dompoint-x">x</a></code> set to <var>x</var> + <var>width</var>,
1786+
<code title="dom-DOMPoint-y"><a href="#dom-dompoint-y">y</a></code> set to <var>y</var> + <var>height</var>, <code title="dom-DOMPoint-z"><a href="#dom-dompoint-z">z</a></code> set to zero and
1787+
<code title="dom-DOMPoint-w"><a href="#dom-dompoint-w">w</a></code> set to one.
1788+
<li><p>Let <var>point 4</var> be a new <code><a href="#dompoint">DOMPoint</a></code> object with <code title="dom-DOMPoint-x"><a href="#dom-dompoint-x">x</a></code> set to <var>x</var>,
1789+
<code title="dom-DOMPoint-y"><a href="#dom-dompoint-y">y</a></code> set to <var>y</var> + <var>height</var>, <code title="dom-DOMPoint-z"><a href="#dom-dompoint-z">z</a></code> set to zero and
1790+
<code title="dom-DOMPoint-w"><a href="#dom-dompoint-w">w</a></code> set to one.
17911791
<li><p>Let <var>bounds</var> be a new <code><a href="#domrectreadonly">DOMRectReadOnly</a></code> object with its attributes set to the values of the namesake attributes in
17921792
<var>rect</var>.
17931793
</ol>
@@ -1802,8 +1802,8 @@ <h3 class="atrisk" id="the-domquad-interface"><span class="secno">11.4 </span>Th
18021802
<var>p3</var>.
18031803
<li><p>Let <var>point 4</var> be a new <code><a href="#dompoint">DOMPoint</a></code> object with its attributes set to the values of the namesake dictionary members in
18041804
<var>p4</var>.
1805-
<li><p>Let <var>bounds</var> be a new <code><a href="#domrectreadonly">DOMRectReadOnly</a></code> object describing the bounding box of <var>point 1</var>, <var>point 2</var>, <var>point
1806-
3</var> and <var>point 4</var>.
1805+
<li><p>Let <var>bounds</var> be a new <code><a href="#domrectreadonly">DOMRectReadOnly</a></code> object describing the smallest bounding box of <var>point 1</var>, <var>point 2</var>,
1806+
<var>point 3</var> and <var>point 4</var>.
18071807
</ol>
18081808
<li><p>Return a new <code><a href="#domquad">DOMQuad</a></code> with <code title="dom-DOMQuad-p1"><a href="#dom-domquad-p1">p1</a></code> set to <var>point 1</var>, <code title="dom-DOMQuad-p2"><a href="#dom-domquad-p2">p2</a></code> set to
18091809
<var>point 2</var>, <code title="dom-DOMQuad-p3"><a href="#dom-domquad-p3">p3</a></code> set to <var>point 3</var> and <code title="dom-DOMQuad-p4"><a href="#dom-domquad-p4">p4</a></code> set to <var>point 4</var>, and
@@ -1822,7 +1822,7 @@ <h3 class="atrisk" id="the-domquad-interface"><span class="secno">11.4 </span>Th
18221822

18231823
<p>The <a href="#associated-bounding-rectangle">associated bounding rectangle</a> is live; whenever the objects in <code title="dom-DOMQuad-p1"><a href="#dom-domquad-p1">p1</a></code>, <code title="dom-DOMQuad-p2"><a href="#dom-domquad-p2">p2</a></code>,
18241824
<code title="dom-DOMQuad-p3"><a href="#dom-domquad-p3">p3</a></code> or <code title="dom-DOMQuad-p4"><a href="#dom-domquad-p4">p4</a></code> are changed, the <a href="#associated-bounding-rectangle">associated bounding rectangle</a> must update its
1825-
attributes as appropriate to describe the new bounding box of the four points.
1825+
attributes as appropriate to describe the new smallest bounding box of the four points.
18261826

18271827

18281828
<h3 class="atrisk" id="the-geometryutils-interface"><span class="secno">11.5 </span>The <code title="">GeometryUtils</code> Interface</h3>

cssom-view/Overview.src.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,21 +1731,21 @@ <h3 class=atrisk>The <code title>DOMQuad</code> Interface</h3>
17311731
<li><p>If invoked with one argument, follow these substeps:
17321732
<ol>
17331733
<li><p>Let <var>rect</var> be the argument.
1734-
<li><p>Let <var>top</var>, <var>right</var>, <var>bottom</var> and <var>left</var> be <var>rect</var>'s the value of <code title=dom-DOMRect-top>top</code>,
1735-
<code title=dom-DOMRect-right>right</code>, <code title=dom-DOMRect-bottom>bottom</code> and <code title=dom-DOMRect-left>left</code> attributes,
1734+
<li><p>Let <var>x</var>, <var>y</var>, <var>width</var> and <var>height</var> be <var>rect</var>'s the value of <code title=dom-DOMRect-x>x</code>,
1735+
<code title=dom-DOMRect-y>y</code>, <code title=dom-DOMRect-width>width</code> and <code title=dom-DOMRect-height>height</code> attributes,
17361736
respectively.
1737-
<li><p>Let <var>point 1</var> be a new <code>DOMPoint</code> object with <code title=dom-DOMPoint-x>x</code> set to <var>left</var>,
1738-
<code title=dom-DOMPoint-y>y</code> set to <var>top</var>, <code title=dom-DOMPoint-z>z</code> set to zero and <code title=dom-DOMPoint-w>w</code> set to
1737+
<li><p>Let <var>point 1</var> be a new <code>DOMPoint</code> object with <code title=dom-DOMPoint-x>x</code> set to <var>x</var>,
1738+
<code title=dom-DOMPoint-y>y</code> set to <var>y</var>, <code title=dom-DOMPoint-z>z</code> set to zero and <code title=dom-DOMPoint-w>w</code> set to
17391739
one.
1740-
<li><p>Let <var>point 2</var> be a new <code>DOMPoint</code> object with <code title=dom-DOMPoint-x>x</code> set to <var>right</var>,
1741-
<code title=dom-DOMPoint-y>y</code> set to <var>top</var>, <code title=dom-DOMPoint-z>z</code> set to zero and <code title=dom-DOMPoint-w>w</code> set to
1742-
one.
1743-
<li><p>Let <var>point 3</var> be a new <code>DOMPoint</code> object with <code title=dom-DOMPoint-x>x</code> set to <var>right</var>,
1744-
<code title=dom-DOMPoint-y>y</code> set to <var>bottom</var>, <code title=dom-DOMPoint-z>z</code> set to zero and <code title=dom-DOMPoint-w>w</code> set to
1745-
one.
1746-
<li><p>Let <var>point 4</var> be a new <code>DOMPoint</code> object with <code title=dom-DOMPoint-x>x</code> set to <var>left</var>,
1747-
<code title=dom-DOMPoint-y>y</code> set to <var>bottom</var>, <code title=dom-DOMPoint-z>z</code> set to zero and <code title=dom-DOMPoint-w>w</code> set to
1740+
<li><p>Let <var>point 2</var> be a new <code>DOMPoint</code> object with <code title=dom-DOMPoint-x>x</code> set to <var>x</var> + <var>width</var>,
1741+
<code title=dom-DOMPoint-y>y</code> set to <var>y</var>, <code title=dom-DOMPoint-z>z</code> set to zero and <code title=dom-DOMPoint-w>w</code> set to
17481742
one.
1743+
<li><p>Let <var>point 3</var> be a new <code>DOMPoint</code> object with <code title=dom-DOMPoint-x>x</code> set to <var>x</var> + <var>width</var>,
1744+
<code title=dom-DOMPoint-y>y</code> set to <var>y</var> + <var>height</var>, <code title=dom-DOMPoint-z>z</code> set to zero and
1745+
<code title=dom-DOMPoint-w>w</code> set to one.
1746+
<li><p>Let <var>point 4</var> be a new <code>DOMPoint</code> object with <code title=dom-DOMPoint-x>x</code> set to <var>x</var>,
1747+
<code title=dom-DOMPoint-y>y</code> set to <var>y</var> + <var>height</var>, <code title=dom-DOMPoint-z>z</code> set to zero and
1748+
<code title=dom-DOMPoint-w>w</code> set to one.
17491749
<li><p>Let <var>bounds</var> be a new <code>DOMRectReadOnly</code> object with its attributes set to the values of the namesake attributes in
17501750
<var>rect</var>.
17511751
</ol>
@@ -1760,8 +1760,8 @@ <h3 class=atrisk>The <code title>DOMQuad</code> Interface</h3>
17601760
<var>p3</var>.
17611761
<li><p>Let <var>point 4</var> be a new <code>DOMPoint</code> object with its attributes set to the values of the namesake dictionary members in
17621762
<var>p4</var>.
1763-
<li><p>Let <var>bounds</var> be a new <code>DOMRectReadOnly</code> object describing the bounding box of <var>point 1</var>, <var>point 2</var>, <var>point
1764-
3</var> and <var>point 4</var>.
1763+
<li><p>Let <var>bounds</var> be a new <code>DOMRectReadOnly</code> object describing the smallest bounding box of <var>point 1</var>, <var>point 2</var>,
1764+
<var>point 3</var> and <var>point 4</var>.
17651765
</ol>
17661766
<li><p>Return a new <code>DOMQuad</code> with <code title=dom-DOMQuad-p1>p1</code> set to <var>point 1</var>, <code title=dom-DOMQuad-p2>p2</code> set to
17671767
<var>point 2</var>, <code title=dom-DOMQuad-p3>p3</code> set to <var>point 3</var> and <code title=dom-DOMQuad-p4>p4</code> set to <var>point 4</var>, and
@@ -1780,7 +1780,7 @@ <h3 class=atrisk>The <code title>DOMQuad</code> Interface</h3>
17801780

17811781
<p>The <span>associated bounding rectangle</span> is live; whenever the objects in <code title=dom-DOMQuad-p1>p1</code>, <code title=dom-DOMQuad-p2>p2</code>,
17821782
<code title=dom-DOMQuad-p3>p3</code> or <code title=dom-DOMQuad-p4>p4</code> are changed, the <span>associated bounding rectangle</span> must update its
1783-
attributes as appropriate to describe the new bounding box of the four points.
1783+
attributes as appropriate to describe the new smallest bounding box of the four points.
17841784

17851785

17861786
<h3 class=atrisk>The <code title>GeometryUtils</code> Interface</h3>

0 commit comments

Comments
 (0)