[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).

Tue, 01 Oct 2013 14:05:37 +0200

author
Simon Pieters <simonp@opera.com>
date
Tue, 01 Oct 2013 14:05:37 +0200
changeset 9311
e251bb56c58e
parent 9310
533b2f3d29b7
child 9312
3c529183812b

[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).

cssom-view/Overview.html file | annotate | diff | comparison | revisions
cssom-view/Overview.src.html file | annotate | diff | comparison | revisions
     1.1 --- a/cssom-view/Overview.html	Tue Oct 01 13:30:46 2013 +0200
     1.2 +++ b/cssom-view/Overview.html	Tue Oct 01 14:05:37 2013 +0200
     1.3 @@ -1773,21 +1773,21 @@
     1.4   <li><p>If invoked with one argument, follow these substeps:
     1.5    <ol>
     1.6     <li><p>Let <var>rect</var> be the argument.
     1.7 -   <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>,
     1.8 -   <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,
     1.9 +   <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>,
    1.10 +   <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,
    1.11     respectively.
    1.12 -   <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>,
    1.13 -   <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
    1.14 +   <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>,
    1.15 +   <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
    1.16     one.
    1.17 -   <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>,
    1.18 -   <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
    1.19 +   <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>,
    1.20 +   <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
    1.21     one.
    1.22 -   <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>,
    1.23 -   <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
    1.24 -   one.
    1.25 -   <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>,
    1.26 -   <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
    1.27 -   one.
    1.28 +   <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>,
    1.29 +   <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
    1.30 +   <code title="dom-DOMPoint-w"><a href="#dom-dompoint-w">w</a></code> set to one.
    1.31 +   <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>,
    1.32 +   <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
    1.33 +   <code title="dom-DOMPoint-w"><a href="#dom-dompoint-w">w</a></code> set to one.
    1.34     <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
    1.35     <var>rect</var>.
    1.36    </ol>
    1.37 @@ -1802,8 +1802,8 @@
    1.38     <var>p3</var>.
    1.39     <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
    1.40     <var>p4</var>.
    1.41 -   <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
    1.42 -   3</var> and <var>point 4</var>.
    1.43 +   <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>,
    1.44 +   <var>point 3</var> and <var>point 4</var>.
    1.45    </ol>
    1.46   <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
    1.47   <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
    1.48 @@ -1822,7 +1822,7 @@
    1.49  
    1.50  <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>,
    1.51  <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
    1.52 -attributes as appropriate to describe the new bounding box of the four points.
    1.53 +attributes as appropriate to describe the new smallest bounding box of the four points.
    1.54  
    1.55  
    1.56  <h3 class="atrisk" id="the-geometryutils-interface"><span class="secno">11.5 </span>The <code title="">GeometryUtils</code> Interface</h3>
     2.1 --- a/cssom-view/Overview.src.html	Tue Oct 01 13:30:46 2013 +0200
     2.2 +++ b/cssom-view/Overview.src.html	Tue Oct 01 14:05:37 2013 +0200
     2.3 @@ -1731,21 +1731,21 @@
     2.4   <li><p>If invoked with one argument, follow these substeps:
     2.5    <ol>
     2.6     <li><p>Let <var>rect</var> be the argument.
     2.7 -   <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>,
     2.8 -   <code title=dom-DOMRect-right>right</code>, <code title=dom-DOMRect-bottom>bottom</code> and <code title=dom-DOMRect-left>left</code> attributes,
     2.9 +   <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>,
    2.10 +   <code title=dom-DOMRect-y>y</code>, <code title=dom-DOMRect-width>width</code> and <code title=dom-DOMRect-height>height</code> attributes,
    2.11     respectively.
    2.12 -   <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>,
    2.13 -   <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
    2.14 +   <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>,
    2.15 +   <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
    2.16     one.
    2.17 -   <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>,
    2.18 -   <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
    2.19 +   <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>,
    2.20 +   <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
    2.21     one.
    2.22 -   <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>,
    2.23 -   <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
    2.24 -   one.
    2.25 -   <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>,
    2.26 -   <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
    2.27 -   one.
    2.28 +   <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>,
    2.29 +   <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
    2.30 +   <code title=dom-DOMPoint-w>w</code> set to one.
    2.31 +   <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>,
    2.32 +   <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
    2.33 +   <code title=dom-DOMPoint-w>w</code> set to one.
    2.34     <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
    2.35     <var>rect</var>.
    2.36    </ol>
    2.37 @@ -1760,8 +1760,8 @@
    2.38     <var>p3</var>.
    2.39     <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
    2.40     <var>p4</var>.
    2.41 -   <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
    2.42 -   3</var> and <var>point 4</var>.
    2.43 +   <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>,
    2.44 +   <var>point 3</var> and <var>point 4</var>.
    2.45    </ol>
    2.46   <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
    2.47   <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
    2.48 @@ -1780,7 +1780,7 @@
    2.49  
    2.50  <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>,
    2.51  <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
    2.52 -attributes as appropriate to describe the new bounding box of the four points.
    2.53 +attributes as appropriate to describe the new smallest bounding box of the four points.
    2.54  
    2.55  
    2.56  <h3 class=atrisk>The <code title>GeometryUtils</code> Interface</h3>

mercurial