From a11d436f0c5191232dde536e9f16f40c0fcfce03 Mon Sep 17 00:00:00 2001 From: qincheng Date: Sun, 23 Nov 2014 12:03:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=AE=80observe=E7=9A=84parseHTML?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- avalon.modern.js | 1 + avalon.observe.js | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/avalon.modern.js b/avalon.modern.js index 685ddfb60..da9008cf9 100644 --- a/avalon.modern.js +++ b/avalon.modern.js @@ -325,6 +325,7 @@ var svg = DOC.createElementNS(svgns, "svg") svg.innerHTML = '' if (!rsvg.test(svg.firstChild)) {// #409 + function enumerateNode(node, targetNode) { if (node && node.childNodes) { var nodes = node.childNodes diff --git a/avalon.observe.js b/avalon.observe.js index 385c2f023..b4c6227a9 100644 --- a/avalon.observe.js +++ b/avalon.observe.js @@ -977,11 +977,10 @@ t.innerHTML = wrap[1] + html + wrap[2] var wrapper = t.content if (wrap[0]) { - var fragment = wrapper.cloneNode(false), firstChild - for (var i = wrap[0]; i--; wrapper = wrapper.lastChild) { - } - while (firstChild = wrapper.firstChild) { // 将wrapper上的节点转移到文档碎片上! - fragment.appendChild(firstChild) + var fragment = wrapper.cloneNode(false) + wrapper = wrapper.lastChild + while (tag = wrapper.firstChild) { // 将wrapper上的节点转移到文档碎片上! + fragment.appendChild(tag) } return fragment }