Skip to content

Commit 4f477e5

Browse files
zcorpansvgeesus
authored andcommitted
Change DOMQuad#bounds to non-live getBounds()
Fixes https://lists.w3.org/Archives/Public/public-fx/2015OctDec/0056.html.
1 parent 1b7b103 commit 4f477e5

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

geometry/Overview.bs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Abstract: This specification provides basic geometric interfaces to represent po
2121
!Issues list: <a href="https://www.w3.org/Bugs/Public/buglist.cgi?product=FXTF&amp;component=Geometry&amp;resolution=---">Bugzilla</a> (<a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=FXTF&amp;component=Geometry">file a bug</a>)
2222
Test Suite: http://test.csswg.org/suites/geometry-1_dev/nightly-unstable/
2323
Use <i> Autolinks: yes
24+
Ignored Vars: f, Point object, m44, e, m42, quad1, m41, stringifier, point object, m12, c, transformPoint, m21, d, m22, quad2
2425
</pre>
2526

2627
<pre class=anchors>
@@ -59,7 +60,7 @@ A 2D or a 3D <dfn>point</dfn> can be represented by the following WebIDL interfa
5960
optional unrestricted double z = 0, optional unrestricted double w = 1),
6061
Exposed=(Window,Worker)]
6162
interface DOMPointReadOnly {
62-
[NewObject] static DOMPointReadOnly fromPoint(optional DOMPointInit point);
63+
[NewObject] static DOMPointReadOnly fromPoint(optional DOMPointInit other);
6364

6465
readonly attribute unrestricted double x;
6566
readonly attribute unrestricted double y;
@@ -104,8 +105,8 @@ The <dfn dfn-type=constructor dfn-for=DOMPointReadOnly><code>DOMPointReadOnly(<v
104105
<li>Return <var>point</var>.</li>
105106
</ol>
106107

107-
The <dfn dfn-for=DOMPointReadOnly id=dom-dompointreadonly-frompoint><code>fromPoint(<var>other</var>)</code></dfn> static method on {{DOMPointReadOnly}} and
108-
the <dfn dfn-for=DOMPoint id=dom-dompoint-frompoint><code>fromPoint(<var>other</var>)</code></dfn> static method on {{DOMPoint}} must run the following steps:
108+
The <dfn method dfn-for=DOMPointReadOnly id=dom-dompointreadonly-frompoint><code>fromPoint(<var>other</var>)</code></dfn> static method on {{DOMPointReadOnly}} and
109+
the <dfn method dfn-for=DOMPoint id=dom-dompoint-frompoint><code>fromPoint(<var>other</var>)</code></dfn> static method on {{DOMPoint}} must run the following steps:
109110

110111
<ol class=algorithm>
111112
<li>Let <var>point</var> be a new {{DOMPointReadOnly}} or {{DOMPoint}} as appropriate.
@@ -271,7 +272,7 @@ interface DOMQuad {
271272
[SameObject] readonly attribute DOMPoint p2;
272273
[SameObject] readonly attribute DOMPoint p3;
273274
[SameObject] readonly attribute DOMPoint p4;
274-
[SameObject] readonly attribute DOMRectReadOnly bounds;
275+
[NewObject] DOMRect getBounds();
275276
};
276277

277278
dictionary DOMQuadInit {
@@ -289,7 +290,7 @@ The <dfn dfn-type=constructor dfn-for=DOMQuad><code>DOMQuad(<var>p1</var>, <var>
289290
<li>Let <var>point 2</var> be a new <a interface>DOMPoint</a> object with its attributes set to the values of the namesake dictionary members in <var>p2</var>.
290291
<li>Let <var>point 3</var> be a new <a interface>DOMPoint</a> object with its attributes set to the values of the namesake dictionary members in <var>p3</var>.
291292
<li>Let <var>point 4</var> be a new <a interface>DOMPoint</a> object with its attributes set to the values of the namesake dictionary members in <var>p4</var>.
292-
<li><p>Return a new <a interface>DOMQuad</a> with <a attribute for=DOMQuad>p1</a> set to <var>point 1</var>, <a attribute for=DOMQuad>p2</a> set to <var>point 2</var>, <a attribute for=DOMQuad>p3</a> set to <var>point 3</var> and <a attribute for=DOMQuad>p4</a> set to <var>point 4</var>, and let the <a>associated bounding rectangle</a> be <var>bounds</var>.
293+
<li><p>Return a new <a interface>DOMQuad</a> with <a attribute for=DOMQuad>p1</a> set to <var>point 1</var>, <a attribute for=DOMQuad>p2</a> set to <var>point 2</var>, <a attribute for=DOMQuad>p3</a> set to <var>point 3</var> and <a attribute for=DOMQuad>p4</a> set to <var>point 4</var>.
293294
</ol>
294295

295296
Note: It is possible to pass <a interface>DOMPoint</a>/<a interface>DOMPointReadOnly</a> arguments as well. The passed arguments will be transformed to the correct object type internally following the WebIDL rules [[!WEBIDL]].
@@ -302,7 +303,7 @@ The <dfn method lt=fromRect() dfn-for=DOMQuad><code>fromRect(<var>other</var>)</
302303
<li>Let <var>point 2</var> be a new <a interface>DOMPoint</a> object with <a attribute for=DOMPoint>x</a> set to <var>x</var> + <var>width</var>, <a attribute for=DOMPoint>y</a> set to <var>y</var>, <a attribute for=DOMPoint>z</a> set to zero and <a attribute for=DOMPoint>w</a> set to one.
303304
<li>Let <var>point 3</var> be a new <a interface>DOMPoint</a> object with <a attribute for=DOMPoint>x</a> set to <var>x</var> + <var>width</var>, <a attribute for=DOMPoint>y</a> set to <var>y</var> + <var>height</var>, <a attribute for=DOMPoint>z</a> set to zero and <a attribute for=DOMPoint>w</a> set to one.
304305
<li>Let <var>point 4</var> be a new <a interface>DOMPoint</a> object with <a attribute for=DOMPoint>x</a> set to <var>x</var>, <a attribute for=DOMPoint>y</a> set to <var>y</var> + <var>height</var>, <a attribute for=DOMPoint>z</a> set to zero and <a attribute for=DOMPoint>w</a> set to one.
305-
<li><p>Return a new <a interface>DOMQuad</a> with <a attribute for=DOMQuad>p1</a> set to <var>point 1</var>, <a attribute for=DOMQuad>p2</a> set to <var>point 2</var>, <a attribute for=DOMQuad>p3</a> set to <var>point 3</var> and <a attribute for=DOMQuad>p4</a> set to <var>point 4</var>, and let the <a>associated bounding rectangle</a> be <var>bounds</var>.
306+
<li><p>Return a new <a interface>DOMQuad</a> with <a attribute for=DOMQuad>p1</a> set to <var>point 1</var>, <a attribute for=DOMQuad>p2</a> set to <var>point 2</var>, <a attribute for=DOMQuad>p3</a> set to <var>point 3</var> and <a attribute for=DOMQuad>p4</a> set to <var>point 4</var>.
306307
</ol>
307308

308309
The <dfn method lt=fromQuad() dfn-for=DOMQuad><code>fromQuad(<var>other</var>)</code></dfn> static method on {{DOMQuad}} must run the following steps:
@@ -325,20 +326,18 @@ The <dfn method lt=fromQuad() dfn-for=DOMQuad><code>fromQuad(<var>other</var>)</
325326
The <dfn>p3</dfn> attribute must return a <a interface>DOMPoint</a> that represents <a attribute>p3</a> of the quadrilateral it was invoked on. The author can modify the returned <a interface>DOMPoint</a> object, which directly affects the quadrilateral.
326327

327328
The <dfn>p4</dfn> attribute must return a <a interface>DOMPoint</a> that represents <a attribute>p4</a> of the quadrilateral it was invoked on. The author can modify the returned <a interface>DOMPoint</a> object, which directly affects the quadrilateral.
328-
329-
The <dfn>bounds</dfn> attribute must return the <a>associated bounding rectangle</a> of the quadrilateral it was invoked on.
330329
</div>
331330

332-
<a interface>DOMQuad</a> objects have an <dfn for=quadlirateral>associated bounding rectangle</dfn> set to a <a interface>DOMRectReadOnly</a> object when created. <a interface>DOMQuad</a> objects must have read and write access to the internal member variables of the <a>associated bounding rectangle</a>. The <a>associated bounding rectangle</a> is live; whenever the objects for <a attribute>p1</a>, <a attribute>p2</a>, <a attribute>p3</a> or <a attribute>p4</a> change, the <a>associated bounding rectangle</a> must update its internal member variable values as appropriate to describe the new smallest bounding box of the four points.
331+
The <dfn method for=DOMQuad>getBounds()</dfn> method, when invoked, must run the following algorithm:
333332

334-
The <a>associated bounding rectangle</a> is computed as follows:
335333
<ol class='algorithm'>
336-
<li>Let <var>bounds</var> be a <a interface>DOMRectReadOnly</a> object.</li>
334+
<li>Let <var>bounds</var> be a <a interface>DOMRect</a> object.</li>
337335
<li>Let <var>left</var> be the minimum of <a attribute>p1</a>.x, <a attribute>p2</a>.x, <a attribute>p3</a>.x and <a attribute>p4</a>.x.</li>
338336
<li>Let <var>top</var> be the minimum of <a attribute>p1</a>.y, <a attribute>p2</a>.y, <a attribute>p3</a>.y and <a attribute>p4</a>.y.</li>
339337
<li>Let <var>right</var> be the maximum of <a attribute>p1</a>.x, <a attribute>p2</a>.x, <a attribute>p3</a>.x and <a attribute>p4</a>.x.</li>
340338
<li>Let <var>bottom</var> be the maximum of <a attribute>p1</a>.y, <a attribute>p2</a>.y, <a attribute>p3</a>.y and <a attribute>p4</a>.y.</li>
341339
<li>Let <a for=rectangle>x coordinate</a> of <var>bounds</var> be <var>left</var>, <a for=rectangle>y coordinate</a> of <var>bounds</var> be <var>top</var>, <a for=rectangle>width dimension</a> of <var>bounds</var> be <var>right</var> - <var>left</var> and <a for=rectangle>height dimension</a> of <var>bounds</var> be <var>bottom</var> - <var>top</var>.</li>
340+
<li>Return <var>bounds</var>.
342341
</ol>
343342

344343
<div class='example'>
@@ -363,7 +362,7 @@ var quad2 = DOMQuad.fromRect(rect);</code></pre>
363362
<circle cx="210" cy="150" r="3" fill="rgb(204, 51, 51)"/>
364363
<circle cx="10" cy="180" r="3" fill="rgb(204, 51, 51)"/>
365364
</svg>
366-
<p class="capture">An irregular quadrilateral represented by a <a interface>DOMQuad</a>. The four red colored circles represent the <a interface>DOMPoint</a> attributes <a attribute>p1</a> to <a attribute>p4</a>. The dashed rectangle represents the <a>associated bounding rectangle</a> <a attribute>bounds</a> of the <a interface>DOMQuad</a>.</p>
365+
<p class="capture">An irregular quadrilateral represented by a <a interface>DOMQuad</a>. The four red colored circles represent the <a interface>DOMPoint</a> attributes <a attribute>p1</a> to <a attribute>p4</a>. The dashed rectangle represents the bounding rectangle returned by the {{DOMQuad/getBounds()}} method of the <a interface>DOMQuad</a>.</p>
367366
</div>
368367
</div>
369368

@@ -673,8 +672,8 @@ the <dfn method lt=fromMatrix() dfn-for=DOMMatrix id=dom-dommatrix-frommatrix><c
673672
</li>
674673
</ol>
675674

676-
The <dfn method lt=fromString() dfn-for=DOMMatrixReadOnly id=dom-dommatrixreadonly-fromstring><code>fromString(<var>transformList</var>)</code></dfn> static method on {{DOMMatrixReadOnly}} and
677-
the <dfn method lt=fromString() dfn-for=DOMMatrix id=dom-dommatrix-fromstring><code>fromString(<var>transformList</var>)</code></dfn> static method on {{DOMMatrix}} must follow these steps:
675+
The <dfn method dfn-for=DOMMatrixReadOnly id=dom-dommatrixreadonly-fromstring><code>fromString(<var>transformList</var>)</code></dfn> static method on {{DOMMatrixReadOnly}} and
676+
the <dfn method dfn-for=DOMMatrix id=dom-dommatrix-fromstring><code>fromString(<var>transformList</var>)</code></dfn> static method on {{DOMMatrix}} must follow these steps:
678677

679678
<ol>
680679
<li>Parse <var>transformList</var> by following the syntax description in “<a href=http://www.w3.org/TR/css-transforms-1/#svg-syntax>Syntax of the SVG ‘transform’ attribute</a>[[!CSS3-TRANSFORMS]] to a <<transform-list>>. If parsing is not successful or any <<transform-function>> has <<length>> values without <a spec='css-values'>absolute length</a> units<!--For WD: <a spec='css-values-3'>absolute length units</a>-->, throw a {{SyntaxError}} exception.</li>
@@ -691,15 +690,15 @@ the <dfn method lt=fromString() dfn-for=DOMMatrix id=dom-dommatrix-fromstring><c
691690
<li>
692691
<dl class=switch>
693692
<dt>If <var>2dTransform</var> is set to <code>true</code></dt>
694-
<dd>Return the result of invoking <a>create a 2d matrix</a> of type {{DOMMatrixReadOnly}} or {{DOMMatrix}} as appropriate, with a sequence of numbers, the values being the elements <var>m11</var>, <var>m12</var>, <var>21</var>, <var>m22</var>, <var>m41</var> and <var>m42</var> of <var>matrix</var> of <var>matrix</var>.</dd>
693+
<dd>Return the result of invoking <a>create a 2d matrix</a> of type {{DOMMatrixReadOnly}} or {{DOMMatrix}} as appropriate, with a sequence of numbers, the values being the elements <var>m11</var>, <var>m12</var>, <var>m21</var>, <var>m22</var>, <var>m41</var> and <var>m42</var> of <var>matrix</var> of <var>matrix</var>.</dd>
695694
<dt>If <var>2dTransform</var> is set to <code>false</code></dt>
696695
<dd>Return the result of invoking <a>create a 3d matrix</a> of type {{DOMMatrixReadOnly}} or {{DOMMatrix}} as appropriate, with a sequence of numbers, the values being the 16 elements of <var>matrix</var>.</dd>
697696
</dl>
698697
</li>
699698
</ol>
700699

701-
The <dfn method lt=fromFloat32Array() dfn-for=DOMMatrixReadOnly id=dom-dommatrixreadonly-fromfloat32array><code>fromFloat32Array(<var>array32</var>)</code></dfn> static method on {{DOMMatrixReadOnly}} and
702-
the <dfn method lt=fromFloat32Array() dfn-for=DOMMatrix id=dom-dommatrix-fromfloat32array><code>fromFloat32Array(<var>array32</var>)</code></dfn> static method on {{DOMMatrix}} must follow these steps:
700+
The <dfn method dfn-for=DOMMatrixReadOnly id=dom-dommatrixreadonly-fromfloat32array><code>fromFloat32Array(<var>array32</var>)</code></dfn> static method on {{DOMMatrixReadOnly}} and
701+
the <dfn method dfn-for=DOMMatrix id=dom-dommatrix-fromfloat32array><code>fromFloat32Array(<var>array32</var>)</code></dfn> static method on {{DOMMatrix}} must follow these steps:
703702

704703
<dl class=switch>
705704
<dt>If <var>array32</var> has 6 elements</dt>
@@ -710,8 +709,8 @@ the <dfn method lt=fromFloat32Array() dfn-for=DOMMatrix id=dom-dommatrix-fromflo
710709
<dd>Throw a <code>TypeError</code> exception.</dd>
711710
</dl>
712711

713-
The <dfn method lt=fromFloat64Array() dfn-for=DOMMatrixReadOnly id=dom-dommatrixreadonly-fromfloat64array><code>fromFloat64Array(<var>array64</var>)</code></dfn> static method on {{DOMMatrixReadOnly}} and
714-
the <dfn method lt=fromFloat64Array() dfn-for=DOMMatrix id=dom-dommatrix-fromfloat64array><code>fromFloat64Array(<var>array64</var>)</code></dfn> static method on {{DOMMatrix}} must follow these steps:
712+
The <dfn method dfn-for=DOMMatrixReadOnly id=dom-dommatrixreadonly-fromfloat64array><code>fromFloat64Array(<var>array64</var>)</code></dfn> static method on {{DOMMatrixReadOnly}} and
713+
the <dfn method dfn-for=DOMMatrix id=dom-dommatrix-fromfloat64array><code>fromFloat64Array(<var>array64</var>)</code></dfn> static method on {{DOMMatrix}} must follow these steps:
715714

716715
<dl class=switch>
717716
<dt>If <var>array64</var> has 6 elements</dt>
@@ -1123,6 +1122,7 @@ The following changes were made since the <a href="http://www.w3.org/TR/2014/WD-
11231122

11241123
<ul>
11251124
<li>Exposed <a interface>DOMPointReadOnly</a>, <a interface>DOMPoint</a>, <a interface>DOMRectReadOnly</a>, <a interface>DOMRect</a>, <a interface>DOMQuad</a>, <a interface>DOMMatrixReadOnly</a> and <a interface>DOMMatrix</a> to <code>Window</code> and <code>Worker</code>. Defined cloning of the interfaces.</li>
1125+
<li>The live <code>bounds</code> attribute on {{DOMQuad}} was replaced with a non-live {{DOMQuad/getBounds()}} method. The "associated bounding rectangle" concept was also removed.
11261126
</ul>
11271127

11281128
The following changes were made since the <a href="http://www.w3.org/TR/2014/WD-geometry-1-20140626/">26 June 2014 Last Call Public Working Draft</a>.

0 commit comments

Comments
 (0)