• R/O
  • HTTP
  • SSH
  • HTTPS

sie: コミット

ブラウザでSVGを表示するSIEの開発 (SIE - to display SVG on legacy browsers)


コミットメタ情報

リビジョン9f8c33841fd9078889d25e3b70e601655d22064f (tree)
日時2012-09-14 23:52:43
作者dhrname <dhrname@user...>
コミッターdhrname

ログメッセージ

insertBeforeメソッドの循環参照の問題を解決

変更サマリ

差分

--- a/org/w3c/core.js
+++ b/org/w3c/core.js
@@ -269,13 +269,11 @@ Node.prototype = {
269269 j = 0,
270270 t,
271271 s, descend, di;
272- if (tp) {
273- while (!tp) { //先祖をたどっていく
274- if (tp === n) { //先祖要素が追加ノードならばエラー
275- throw (new DOMException(/*DOMException.HIERARCHY_REQUEST_ERR*/ 3));
276- }
277- tp = tp.parentNode;
272+ while (tp) { //先祖をたどっていく
273+ if (tp === n) { //先祖要素が追加ノードならばエラー
274+ throw (new DOMException(/*DOMException.HIERARCHY_REQUEST_ERR*/ 3));
278275 }
276+ tp = tp.parentNode;
279277 }
280278 if (this.ownerDocument !== n.ownerDocument) { //所属Documentの生成元が違うならば
281279 throw (new DOMException(/*DOMException.WRONG_DOCUMENT_ERR*/ 4));
--- a/org/w3c/dom/events.js
+++ b/org/w3c/dom/events.js
@@ -386,13 +386,11 @@ MutationEvent.prototype = Object._create(Event);
386386 j = 0,
387387 t,
388388 s, descend, di;
389- if (tp) {
390- while (!tp) { //先祖をたどっていく
391- if (tp === n) { //先祖要素が追加ノードならばエラー
392- throw (new DOMException(/*DOMException.HIERARCHY_REQUEST_ERR*/ 3));
393- }
394- tp = tp.parentNode;
389+ while (tp) { //先祖をたどっていく
390+ if (tp === n) { //先祖要素が追加ノードならばエラー
391+ throw (new DOMException(/*DOMException.HIERARCHY_REQUEST_ERR*/ 3));
395392 }
393+ tp = tp.parentNode;
396394 }
397395 if (this.ownerDocument !== n.ownerDocument) { //所属Documentの生成元が違うならば
398396 throw (new DOMException(/*DOMException.WRONG_DOCUMENT_ERR*/ 4));
--- a/tool/Spec/spec/SvgDomSpec.js
+++ b/tool/Spec/spec/SvgDomSpec.js
@@ -1711,6 +1711,7 @@ describe("SVG Spec in JavaScript", function() {
17111711 /*NOT_FOUND_ERR DOMException*/
17121712 s.insertBefore(t, t.cloneNode(false));
17131713 };
1714+ expect(sn).toThrow();
17141715 expect(tn).toThrow();
17151716 expect(un).toThrow();
17161717 });
旧リポジトリブラウザで表示