[Sie-announce] SIEコード [2850] インラインSVGに関する_ca関数のバグを修正

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 8月 9日 (火) 00:31:42 JST


Revision: 2850
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2850
Author:   dhrname
Date:     2011-08-09 00:31:42 +0900 (Tue, 09 Aug 2011)

Log Message:
-----------
インラインSVGに関する_ca関数のバグを修正

Modified Paths:
--------------
    branches/08x/083/org/w3c/dom/svg.js

Modified: branches/08x/083/org/w3c/dom/svg.js
===================================================================
--- branches/08x/083/org/w3c/dom/svg.js	2011-08-06 10:33:55 UTC (rev 2849)
+++ branches/08x/083/org/w3c/dom/svg.js	2011-08-08 15:31:42 UTC (rev 2850)
@@ -1690,11 +1690,16 @@
      *ここでは、responseTextを用いる
      */
     var dsd = new Date();
-    var ifr = this._tar.previousSibling;
-    ifr.contentWindow.screen.updateInterval = 999;
-    var _doc = ifr.contentWindow.document;
-    _doc.write("");
-    _doc.close(); // これがないと document.body は null になる
+    var ifr = this._tar.previousSibling,
+        _doc;
+    if (ifr.contentWindow) {
+      ifr.contentWindow.screen.updateInterval = 999;
+      _doc = ifr.contentWindow.document;
+      _doc.write("");
+      _doc.close(); // これがないと document.body は null になる
+    } else {        //インラインSVGの場合
+      _doc = document;
+    }
     if (("namespaces" in _doc) && !_doc.namespaces["v"]) {
       _doc.namespaces.add("v","urn:schemas-microsoft-com:vml");
       _doc.namespaces.add("o","urn:schemas-microsoft-com:office:office");
@@ -1723,7 +1728,9 @@
           oba = _doc.createElement("div"); //obaはradialGradient要素で使う
     oba.setAttribute("id","_NAIBU_outline");
     _doc.body.appendChild(oba);
-    _doc.body.style.backgroundColor = objei.parentNode.currentStyle.backgroundColor;
+    if (ifr.contentWindow) {
+       _doc.body.style.backgroundColor = objei.parentNode.currentStyle.backgroundColor;
+    }
     s._document_ = _doc; //_document_プロパティはradialGradient要素やNAIBU._setPaintなどで使う
     ndoc.async = false;
     /*下記のプロパティについては、Microsoftのサイトを参照
@@ -1785,7 +1792,11 @@
     dcp.style.height = tview.height+ "px";
     dcp.coordsize = tview.width+ " " +tview.height;
     sp.appendChild(dcp);
-    _doc.body.appendChild(sp);
+    if (ifr.contentWindow) {
+      _doc.body.appendChild(sp);
+    } else {
+      this._tar.prentNode.insertBefore(sp, this._tar);
+    }
     dcp.appendChild(sdt);
     while (fi) { //子ノードを検索して、子供がいれば、importNodeメソッドを再帰的に実行する
       n = s.importNode(fi, true);
@@ -1872,7 +1883,7 @@
     this.xmlhttp.onreadystatechange = NAIBU.emptyFunction;
     alert(+(new Date()) - dsd.getTime())
     if (this._next) {
-      ifr.contentWindow.screen.updateInterval = 0;
+      ifr.contentWindow && (ifr.contentWindow.screen.updateInterval = 0);
       ifr = s = null;
       this._next._init();
     } else {




Sie-announce メーリングリストの案内
Back to archive index