Skip to content

Commit 0f74da5

Browse files
author
Simon Pieters
committed
[cssom-view] Make DOMRect mutable except for the DOMQuad#bounds one. http://lists.w3.org/Archives/Public/www-style/2013Sep/0616.html
--HG-- extra : rebase_source : d1f51745b28057052ae467bf424807b3bdff9e9b
1 parent 3cf2a96 commit 0f74da5

2 files changed

Lines changed: 56 additions & 38 deletions

File tree

cssom-view/Overview.html

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,16 +1613,16 @@ <h3 id="the-domrectlist-interface"><span class="secno">11.1 </span>The <code tit
16131613
<h3 id="the-domrect-interface"><span class="secno">11.2 </span>The <code title="">DOMRect</code> Interface</h3>
16141614

16151615
<p>Objects implementing the <code><a href="#domrect">DOMRect</a></code> interface represent a rectangular box. The type of box is specified by the method that returns a
1616-
<code><a href="#domrect">DOMRect</a></code> object.</p>
1616+
<code><a href="#domrect">DOMRect</a></code> object. A <code><a href="#domrect">DOMRect</a></code> object has a <i>readonly</i> flag, which is unset unless otherwise stated.</p>
16171617

16181618
<pre class="idl">[<a href="#dom-domrect" title="dom-DOMRect">Constructor</a>(double left, double top, double width, double height)]
16191619
interface <dfn id="domrect">DOMRect</dfn> {
1620-
readonly attribute double <a href="#dom-domrect-top" title="dom-DOMRect-top">top</a>;
1621-
readonly attribute double <a href="#dom-domrect-right" title="dom-DOMRect-right">right</a>;
1622-
readonly attribute double <a href="#dom-domrect-bottom" title="dom-DOMRect-bottom">bottom</a>;
1623-
readonly attribute double <a href="#dom-domrect-left" title="dom-DOMRect-left">left</a>;
1624-
readonly attribute double <a href="#dom-domrect-width" title="dom-DOMRect-width">width</a>;
1625-
readonly attribute double <a href="#dom-domrect-height" title="dom-DOMRect-height">height</a>;
1620+
attribute double <a href="#dom-domrect-top" title="dom-DOMRect-top">top</a>;
1621+
attribute double <a href="#dom-domrect-right" title="dom-DOMRect-right">right</a>;
1622+
attribute double <a href="#dom-domrect-bottom" title="dom-DOMRect-bottom">bottom</a>;
1623+
attribute double <a href="#dom-domrect-left" title="dom-DOMRect-left">left</a>;
1624+
attribute double <a href="#dom-domrect-width" title="dom-DOMRect-width">width</a>;
1625+
attribute double <a href="#dom-domrect-height" title="dom-DOMRect-height">height</a>;
16261626
};</pre>
16271627

16281628
<p class="atrisk">The <dfn id="dom-domrect" title="dom-DOMRect"><code>DOMRect(<var>left</var>, <var>top</var>, <var>width</var>, <var>height</var>)</code></dfn> constructor, when
@@ -1636,22 +1636,30 @@ <h3 id="the-domrect-interface"><span class="secno">11.2 </span>The <code title="
16361636
<var>left</var>.
16371637
</ol>
16381638

1639-
<p>The <dfn id="dom-domrect-top" title="dom-DOMRect-top"><code>top</code></dfn> attribute must return the y-coordinate, relative to the <a href="#viewport">viewport</a> origin, of the top of
1640-
the rectangle box.</p>
1639+
<p>The <dfn id="dom-domrect-top" title="dom-DOMRect-top"><code>top</code></dfn> attribute gives the y-coordinate, relative to the <a href="#viewport">viewport</a> origin, of the top of
1640+
the rectangle box. On getting, it must return the current value. On setting, if the <i>readonly</i> flag is set, a
1641+
<code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#nomodificationallowederror">NoModificationAllowedError</a></code> exception must be thrown. Otherwise, the current value must be set to the new value.</p>
16411642

1642-
<p>The <dfn id="dom-domrect-right" title="dom-DOMRect-right"><code>right</code></dfn> attribute must return the x-coordinate, relative to the <a href="#viewport">viewport</a> origin, of the
1643-
right of the rectangle box.</p>
1643+
<p>The <dfn id="dom-domrect-right" title="dom-DOMRect-right"><code>right</code></dfn> attribute gives the x-coordinate, relative to the <a href="#viewport">viewport</a> origin, of the
1644+
right of the rectangle box. On getting, it must return the current value. On setting, if the <i>readonly</i> flag is set, a
1645+
<code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#nomodificationallowederror">NoModificationAllowedError</a></code> exception must be thrown. Otherwise, the current value must be set to the new value.</p>
16441646

1645-
<p>The <dfn id="dom-domrect-bottom" title="dom-DOMRect-bottom"><code>bottom</code></dfn> attribute must return the y-coordinate, relative to the <a href="#viewport">viewport</a> origin, of the
1646-
bottom of the rectangle box.</p>
1647+
<p>The <dfn id="dom-domrect-bottom" title="dom-DOMRect-bottom"><code>bottom</code></dfn> attribute gives the y-coordinate, relative to the <a href="#viewport">viewport</a> origin, of the
1648+
bottom of the rectangle box. On getting, it must return the current value. On setting, if the <i>readonly</i> flag is set, a
1649+
<code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#nomodificationallowederror">NoModificationAllowedError</a></code> exception must be thrown. Otherwise, the current value must be set to the new value.</p>
16471650

1648-
<p>The <dfn id="dom-domrect-left" title="dom-DOMRect-left"><code>left</code></dfn> attribute must return the x-coordinate, relative to the <a href="#viewport">viewport</a> origin, of the left
1649-
of the rectangle box.</p>
1651+
<p>The <dfn id="dom-domrect-left" title="dom-DOMRect-left"><code>left</code></dfn> attribute gives the x-coordinate, relative to the <a href="#viewport">viewport</a> origin, of the left
1652+
of the rectangle box. On getting, it must return the current value. On setting, if the <i>readonly</i> flag is set, a
1653+
<code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#nomodificationallowederror">NoModificationAllowedError</a></code> exception must be thrown. Otherwise, the current value must be set to the new value.</p>
16501654

1651-
<p>The <dfn id="dom-domrect-width" title="dom-DOMRect-width"><code>width</code></dfn> attribute must return the value of <code title="dom-DOMRect-right"><a href="#dom-domrect-right">right</a></code> minus
1655+
<p>The <dfn id="dom-domrect-width" title="dom-DOMRect-width"><code>width</code></dfn> attribute, on getting, must return the value of <code title="dom-DOMRect-right"><a href="#dom-domrect-right">right</a></code> minus
1656+
<code title="dom-DOMRect-left"><a href="#dom-domrect-left">left</a></code>. On setting, if the <i>readonly</i> flag is set, a <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#nomodificationallowederror">NoModificationAllowedError</a></code>
1657+
exception must be thrown. Otherwise, the <code title="dom-DOMRect-right"><a href="#dom-domrect-right">right</a></code> attribute must be set to the new value plus the value of
16521658
<code title="dom-DOMRect-left"><a href="#dom-domrect-left">left</a></code>.</p>
16531659

1654-
<p>The <dfn id="dom-domrect-height" title="dom-DOMRect-height"><code>height</code></dfn> attribute must return the value of <code title="dom-DOMRect-bottom"><a href="#dom-domrect-bottom">bottom</a></code> minus
1660+
<p>The <dfn id="dom-domrect-height" title="dom-DOMRect-height"><code>height</code></dfn> attribute, on getting, must return the value of <code title="dom-DOMRect-bottom"><a href="#dom-domrect-bottom">bottom</a></code>
1661+
minus <code title="dom-DOMRect-top"><a href="#dom-domrect-top">top</a></code>. On setting, if the <i>readonly</i> flag is set, a <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#nomodificationallowederror">NoModificationAllowedError</a></code>
1662+
exception must be thrown. Otherwise, the <code title="dom-DOMRect-bottom"><a href="#dom-domrect-bottom">bottom</a></code> attribute must be set to the new value plus the value of
16551663
<code title="dom-DOMRect-top"><a href="#dom-domrect-top">top</a></code>.</p>
16561664

16571665

@@ -1740,7 +1748,8 @@ <h3 class="atrisk" id="the-domquad-interface"><span class="secno">11.4 </span>Th
17401748
<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>,
17411749
<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
17421750
one.
1743-
<li><p>Let <var>bounds</var> be a new <code><a href="#domrect">DOMRect</a></code> object with its attributes set to the values of the namesake attributes in <var>rect</var>.
1751+
<li><p>Let <var>bounds</var> be a new <code><a href="#domrect">DOMRect</a></code> object with its attributes set to the values of the namesake attributes in <var>rect</var>, and
1752+
with the <i>readonly</i> flag set.
17441753
</ol>
17451754
<li><p>Otherwise, follow these substeps:
17461755
<ol>
@@ -1754,7 +1763,7 @@ <h3 class="atrisk" id="the-domquad-interface"><span class="secno">11.4 </span>Th
17541763
<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
17551764
<var>p4</var>.
17561765
<li><p>Let <var>bounds</var> be a new <code><a href="#domrect">DOMRect</a></code> object describing the bounding box of <var>point 1</var>, <var>point 2</var>, <var>point 3</var>
1757-
and <var>point 4</var>.
1766+
and <var>point 4</var>, and with the <i>readonly</i> flag set.
17581767
</ol>
17591768
<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
17601769
<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

cssom-view/Overview.src.html

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,16 +1571,16 @@ <h3>The <code title>DOMRectList</code> Interface</h3>
15711571
<h3>The <code title>DOMRect</code> Interface</h3>
15721572

15731573
<p>Objects implementing the <code>DOMRect</code> interface represent a rectangular box. The type of box is specified by the method that returns a
1574-
<code>DOMRect</code> object.</p>
1574+
<code>DOMRect</code> object. A <code>DOMRect</code> object has a <i>readonly</i> flag, which is unset unless otherwise stated.</p>
15751575

15761576
<pre class=idl>[<span title=dom-DOMRect>Constructor</span>(double left, double top, double width, double height)]
15771577
interface <dfn>DOMRect</dfn> {
1578-
readonly attribute double <span title=dom-DOMRect-top>top</span>;
1579-
readonly attribute double <span title=dom-DOMRect-right>right</span>;
1580-
readonly attribute double <span title=dom-DOMRect-bottom>bottom</span>;
1581-
readonly attribute double <span title=dom-DOMRect-left>left</span>;
1582-
readonly attribute double <span title=dom-DOMRect-width>width</span>;
1583-
readonly attribute double <span title=dom-DOMRect-height>height</span>;
1578+
attribute double <span title=dom-DOMRect-top>top</span>;
1579+
attribute double <span title=dom-DOMRect-right>right</span>;
1580+
attribute double <span title=dom-DOMRect-bottom>bottom</span>;
1581+
attribute double <span title=dom-DOMRect-left>left</span>;
1582+
attribute double <span title=dom-DOMRect-width>width</span>;
1583+
attribute double <span title=dom-DOMRect-height>height</span>;
15841584
};</pre>
15851585

15861586
<p class=atrisk>The <dfn title=dom-DOMRect><code>DOMRect(<var>left</var>, <var>top</var>, <var>width</var>, <var>height</var>)</code></dfn> constructor, when
@@ -1594,22 +1594,30 @@ <h3>The <code title>DOMRect</code> Interface</h3>
15941594
<var>left</var>.
15951595
</ol>
15961596

1597-
<p>The <dfn title=dom-DOMRect-top><code>top</code></dfn> attribute must return the y-coordinate, relative to the <span>viewport</span> origin, of the top of
1598-
the rectangle box.</p>
1597+
<p>The <dfn title=dom-DOMRect-top><code>top</code></dfn> attribute gives the y-coordinate, relative to the <span>viewport</span> origin, of the top of
1598+
the rectangle box. On getting, it must return the current value. On setting, if the <i>readonly</i> flag is set, a
1599+
<code data-anolis-spec=dom>NoModificationAllowedError</code> exception must be thrown. Otherwise, the current value must be set to the new value.</p>
15991600

1600-
<p>The <dfn title=dom-DOMRect-right><code>right</code></dfn> attribute must return the x-coordinate, relative to the <span>viewport</span> origin, of the
1601-
right of the rectangle box.</p>
1601+
<p>The <dfn title=dom-DOMRect-right><code>right</code></dfn> attribute gives the x-coordinate, relative to the <span>viewport</span> origin, of the
1602+
right of the rectangle box. On getting, it must return the current value. On setting, if the <i>readonly</i> flag is set, a
1603+
<code data-anolis-spec=dom>NoModificationAllowedError</code> exception must be thrown. Otherwise, the current value must be set to the new value.</p>
16021604

1603-
<p>The <dfn title=dom-DOMRect-bottom><code>bottom</code></dfn> attribute must return the y-coordinate, relative to the <span>viewport</span> origin, of the
1604-
bottom of the rectangle box.</p>
1605+
<p>The <dfn title=dom-DOMRect-bottom><code>bottom</code></dfn> attribute gives the y-coordinate, relative to the <span>viewport</span> origin, of the
1606+
bottom of the rectangle box. On getting, it must return the current value. On setting, if the <i>readonly</i> flag is set, a
1607+
<code data-anolis-spec=dom>NoModificationAllowedError</code> exception must be thrown. Otherwise, the current value must be set to the new value.</p>
16051608

1606-
<p>The <dfn title=dom-DOMRect-left><code>left</code></dfn> attribute must return the x-coordinate, relative to the <span>viewport</span> origin, of the left
1607-
of the rectangle box.</p>
1609+
<p>The <dfn title=dom-DOMRect-left><code>left</code></dfn> attribute gives the x-coordinate, relative to the <span>viewport</span> origin, of the left
1610+
of the rectangle box. On getting, it must return the current value. On setting, if the <i>readonly</i> flag is set, a
1611+
<code data-anolis-spec=dom>NoModificationAllowedError</code> exception must be thrown. Otherwise, the current value must be set to the new value.</p>
16081612

1609-
<p>The <dfn title=dom-DOMRect-width><code>width</code></dfn> attribute must return the value of <code title=dom-DOMRect-right>right</code> minus
1613+
<p>The <dfn title=dom-DOMRect-width><code>width</code></dfn> attribute, on getting, must return the value of <code title=dom-DOMRect-right>right</code> minus
1614+
<code title=dom-DOMRect-left>left</code>. On setting, if the <i>readonly</i> flag is set, a <code data-anolis-spec=dom>NoModificationAllowedError</code>
1615+
exception must be thrown. Otherwise, the <code title=dom-DOMRect-right>right</code> attribute must be set to the new value plus the value of
16101616
<code title=dom-DOMRect-left>left</code>.</p>
16111617

1612-
<p>The <dfn title=dom-DOMRect-height><code>height</code></dfn> attribute must return the value of <code title=dom-DOMRect-bottom>bottom</code> minus
1618+
<p>The <dfn title=dom-DOMRect-height><code>height</code></dfn> attribute, on getting, must return the value of <code title=dom-DOMRect-bottom>bottom</code>
1619+
minus <code title=dom-DOMRect-top>top</code>. On setting, if the <i>readonly</i> flag is set, a <code data-anolis-spec=dom>NoModificationAllowedError</code>
1620+
exception must be thrown. Otherwise, the <code title=dom-DOMRect-bottom>bottom</code> attribute must be set to the new value plus the value of
16131621
<code title=dom-DOMRect-top>top</code>.</p>
16141622

16151623

@@ -1698,7 +1706,8 @@ <h3 class=atrisk>The <code title>DOMQuad</code> Interface</h3>
16981706
<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>,
16991707
<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
17001708
one.
1701-
<li><p>Let <var>bounds</var> be a new <code>DOMRect</code> object with its attributes set to the values of the namesake attributes in <var>rect</var>.
1709+
<li><p>Let <var>bounds</var> be a new <code>DOMRect</code> object with its attributes set to the values of the namesake attributes in <var>rect</var>, and
1710+
with the <i>readonly</i> flag set.
17021711
</ol>
17031712
<li><p>Otherwise, follow these substeps:
17041713
<ol>
@@ -1712,7 +1721,7 @@ <h3 class=atrisk>The <code title>DOMQuad</code> Interface</h3>
17121721
<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
17131722
<var>p4</var>.
17141723
<li><p>Let <var>bounds</var> be a new <code>DOMRect</code> object describing the bounding box of <var>point 1</var>, <var>point 2</var>, <var>point 3</var>
1715-
and <var>point 4</var>.
1724+
and <var>point 4</var>, and with the <i>readonly</i> flag set.
17161725
</ol>
17171726
<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
17181727
<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

0 commit comments

Comments
 (0)