From b375083d9628c6af7b07eb66116e54d358ed68d7 Mon Sep 17 00:00:00 2001 From: qincheng Date: Tue, 18 Nov 2014 02:05:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DIE6-8=E4=B8=8B=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E7=94=9F=E6=88=90tr=E5=85=83=E7=B4=A0=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=B5=8F=E8=A7=88=E5=99=A8=E7=A7=81=E8=87=AA=E6=8F=92?= =?UTF-8?q?=E5=85=A5caption=E5=85=83=E7=B4=A0=EF=BC=8C=E5=AF=BC=E8=87=B4lo?= =?UTF-8?q?cateFragment=E6=96=B9=E6=B3=95=E8=AE=A1=E7=AE=97=E5=87=BA?= =?UTF-8?q?=E9=94=99=E7=9A=84BUG=20fix=20https://github.com/RubyLouvre/ava?= =?UTF-8?q?lon/issues/572?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- avalon.js | 10 +++++++++- avalon.min.js | 23 ++++++++++++----------- examples/avalon.shim.js | 10 +++++++++- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/avalon.js b/avalon.js index a71360294..85a1a07ea 100644 --- a/avalon.js +++ b/avalon.js @@ -1694,7 +1694,7 @@ for (i = wrap[0]; i--; wrapper = wrapper.lastChild) { } if (!W3C) { //fix IE - for (els = wrapper["getElementsByTagName"]("br"), i = 0; el = els[i++]; ) { + for (els = avalon.slice(wrapper["getElementsByTagName"]("br")), i = 0; el = els[i++]; ) { if (el.className && el.className === "msNoScope") { el.parentNode.removeChild(el) } @@ -1704,6 +1704,14 @@ fixVML(el) } } + if (tag === "tr") { + for (els = avalon.slice(wrapper.children), i = 0; el = els[i++]; ) { + // IE6-8,如果动态生成tr元素,必须会在后面添加早已废弃caption的标签,其nodeName,innerHTML都为"" + if (el.nodeName == "") { + el.parentNode.removeChild(el) + } + } + } } while (firstChild = wrapper.firstChild) { // 将wrapper上的节点转移到文档碎片上! fragment.appendChild(firstChild) diff --git a/avalon.min.js b/avalon.min.js index e03bf4959..133256655 100644 --- a/avalon.min.js +++ b/avalon.min.js @@ -60,17 +60,18 @@ b]=function(b){return x[c+":get"](this[0],void 0,!0===b?2:0)}});avalon.fn.offset return{top:c.top+h-b,left:c.left+e-g}};var Pc=/^]+))?)*\s+value[\s=]/i,Ka={"option:get":r.VBArray?function(b){return Pc.test(b.outerHTML)?b.value:b.text.trim()}:function(b){return b.value},"select:get":function(b,c){for(var d,e=b.options,f=b.selectedIndex,g=Ka["option:get"],h="select-one"===b.type||0>f,k=h?null:[],l=h?f+1:e.length,m=0>f?l:h?f:0;m"],param:[1,""],col:[2,"","
"],legend:[1,"
"],option:[1,"