Add unit accessors to SVGAnimatedLength. (ACTION-3414)
authorCameron McCormack <cam@mcc.id.au>
Wed, 06 Feb 2013 16:17:14 +1100
changeset 434 ef2fa575d779
parent 433 da96436a276e
child 435 db28315a2167
Add unit accessors to SVGAnimatedLength. (ACTION-3414)
master/changes.html
master/types.html
--- a/master/changes.html	Wed Feb 06 12:27:34 2013 +1100
+++ b/master/changes.html	Wed Feb 06 16:17:14 2013 +1100
@@ -64,6 +64,8 @@
   <li>Added constructors to <a>SVGNumber</a>, <a>SVGLength</a>, <a>SVGAngle</a> and <a>SVGRect</a>.</li>
 
   <li>Added <a href="types.html#__svg__SVGLocatableElement__getStrokeBBox">getStrokeBBox</a> to get the tight stroke bounding box.</li>
+
+  <li>Added base value accessors on <a>SVGAnimatedLength</a> for each of the CSS length units supported.</li>
 </ul>
 
 <h3 id="structure">Document Structure chapter</h3>
--- a/master/types.html	Wed Feb 06 12:27:34 2013 +1100
+++ b/master/types.html	Wed Feb 06 16:17:14 2013 +1100
@@ -2856,7 +2856,29 @@
 <pre class="idl">interface <b>SVGAnimatedLength</b> {
   readonly attribute <a class="idlinterface" href="types.html#InterfaceSVGLength">SVGLength</a> <a href="types.html#__svg__SVGAnimatedLength__baseVal">baseVal</a>;
   readonly attribute <a class="idlinterface" href="types.html#InterfaceSVGLength">SVGLength</a> <a href="types.html#__svg__SVGAnimatedLength__animVal">animVal</a>;
-};</pre><dl class="interface">
+
+           attribute float <a href="#__svg__SVGAnimatedLength__cm">cm</a>;
+           attribute float <a href="#__svg__SVGAnimatedLength__em">em</a>;
+           attribute float <a href="#__svg__SVGAnimatedLength__ex">ex</a>;
+           attribute float <a href="#__svg__SVGAnimatedLength__in">in</a>;
+           attribute float <a href="#__svg__SVGAnimatedLength__mm">mm</a>;
+           attribute float <a href="#__svg__SVGAnimatedLength__pc">pc</a>;
+           attribute float <a href="#__svg__SVGAnimatedLength__pt">pt</a>;
+           attribute float <a href="#__svg__SVGAnimatedLength__px">px</a>;
+};</pre>
+
+<p class="issue">We should add accessors for the <code>ch</code>,
+<code>rem</code>, <code>vw</code>, <code>vh</code>, <code>vmin</code>
+and <code>vmax</code> units once we support css3-values more fully.</p>
+
+<p class="issue">Since SVGAnimatedLength objects can represent percentage
+values too, what should we name the accessor for that unit?</p>
+
+<p class="issue">Should we add a string accessor, perhaps named
+<code>asString</code> or <code>value</code>, to avoid having to write for example
+<code>rect.x.baseVal.valueAsString</code>?</p>
+
+<dl class="interface">
 <dt class="attributes-header">Attributes:</dt>
 <dd>
 <dl class="attributes">
@@ -2881,6 +2903,59 @@
 
 </div>
 </dd>
+
+<div class="ready-for-wg-review">
+
+<dt id="__svg__SVGAnimatedLength__cm" class="attribute"><b>cm</b><span class="idl-type-parenthetical"> (float)</span></dt>
+<dd class="attribute">
+  <div>On getting, returns the base value of the animated length in <b>cm</b>.
+  On setting, changes the base value to be in <b>cm</b> and to have the specified magnitude.</div>
+</dd>
+
+<dt id="__svg__SVGAnimatedLength__em" class="attribute"><b>em</b><span class="idl-type-parenthetical"> (float)</span></dt>
+<dd class="attribute">
+  <div>On getting, returns the base value of the animated length in <b>em</b>.
+  On setting, changes the base value to be in <b>em</b> and to have the specified magnitude.</div>
+</dd>
+
+<dt id="__svg__SVGAnimatedLength__ex" class="attribute"><b>ex</b><span class="idl-type-parenthetical"> (float)</span></dt>
+<dd class="attribute">
+  <div>On getting, returns the base value of the animated length in <b>ex</b>.
+  On setting, changes the base value to be in <b>ex</b> and to have the specified magnitude.</div>
+</dd>
+
+<dt id="__svg__SVGAnimatedLength__in" class="attribute"><b>in</b><span class="idl-type-parenthetical"> (float)</span></dt>
+<dd class="attribute">
+  <div>On getting, returns the base value of the animated length in <b>in</b>.
+  On setting, changes the base value to be in <b>in</b> and to have the specified magnitude.</div>
+</dd>
+
+<dt id="__svg__SVGAnimatedLength__mm" class="attribute"><b>mm</b><span class="idl-type-parenthetical"> (float)</span></dt>
+<dd class="attribute">
+  <div>On getting, returns the base value of the animated length in <b>mm</b>.
+  On setting, changes the base value to be in <b>mm</b> and to have the specified magnitude.</div>
+</dd>
+
+<dt id="__svg__SVGAnimatedLength__pc" class="attribute"><b>pc</b><span class="idl-type-parenthetical"> (float)</span></dt>
+<dd class="attribute">
+  <div>On getting, returns the base value of the animated length in <b>pc</b>.
+  On setting, changes the base value to be in <b>pc</b> and to have the specified magnitude.</div>
+</dd>
+
+<dt id="__svg__SVGAnimatedLength__pt" class="attribute"><b>pt</b><span class="idl-type-parenthetical"> (float)</span></dt>
+<dd class="attribute">
+  <div>On getting, returns the base value of the animated length in <b>pt</b>.
+  On setting, changes the base value to be in <b>pt</b> and to have the specified magnitude.</div>
+</dd>
+
+<dt id="__svg__SVGAnimatedLength__px" class="attribute"><b>px</b><span class="idl-type-parenthetical"> (float)</span></dt>
+<dd class="attribute">
+  <div>On getting, returns the base value of the animated length in <b>px</b>.
+  On setting, changes the base value to be in <b>px</b> and to have the specified magnitude.</div>
+</dd>
+
+</div>
+
 </dl>
 </dd>
 </dl>