Skip to content

Commit

Permalink
精简observe的parseHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
qincheng committed Nov 23, 2014
1 parent 42f6007 commit a11d436
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions avalon.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@
var svg = DOC.createElementNS(svgns, "svg")
svg.innerHTML = '<circle cx="50" cy="50" r="40" fill="red" />'
if (!rsvg.test(svg.firstChild)) {// #409

function enumerateNode(node, targetNode) {
if (node && node.childNodes) {
var nodes = node.childNodes
Expand Down
9 changes: 4 additions & 5 deletions avalon.observe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a11d436

Please sign in to comment.