[Sie-announce] SIEコード [2716] SVGAnimateColorを修正して、animateColor要素でinheritやcurrentColorを

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2011年 5月 29日 (日) 19:09:02 JST


Revision: 2716
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2716
Author:   dhrname
Date:     2011-05-29 19:09:02 +0900 (Sun, 29 May 2011)

Log Message:
-----------
SVGAnimateColorを修正して、animateColor要素でinheritやcurrentColorを
値として指定したときもサポート

Modified Paths:
--------------
    branches/07x/078/org/w3c/dom/svg.js

Modified: branches/07x/078/org/w3c/dom/svg.js
===================================================================
--- branches/07x/078/org/w3c/dom/svg.js	2011-05-27 11:03:12 UTC (rev 2715)
+++ branches/07x/078/org/w3c/dom/svg.js	2011-05-29 10:09:02 UTC (rev 2716)
@@ -5487,13 +5487,20 @@
     tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){
       var tar = evt.target,
           attrName = tar.getAttributeNS(null, "attributeName"),
-          ttr = tar.targetElement;
+          ttr = tar.targetElement,
+          fstyle = tar.ownerDocument.defaultView.getComputedStyle(ttr, "");
       if (!tar._values[0]) {
-        tar._values[0] = tar.ownerDocument.defaultView.getComputedStyle(ttr, "").getPropertyValue(attrName);
+        tar._values[0] = fstyle.getPropertyValue(attrName);
       }
       for (var i=0, tav=tar._values, tvli=tav.length;i<tvli;++i) {
         var to = new SVGColor();
-        to.setRGBColor(tar._values[i]);
+        if (tar._values[i] === "currentColor") {
+          to.setRGBColor(fstyle.getPropertyValue("color") || "black");
+        } else if (tar._values[i] === "inherit") {
+          to.setRGBColor(fstyle.getPropertyValue(attrName) || "black");
+        } else {
+          to.setRGBColor(tar._values[i]);
+        }
         tar._valueList[tar._valueList.length] = to;
         to = null;
       }




Sie-announce メーリングリストの案内
アーカイブの一覧に戻る