diff --git a/avalon.js b/avalon.js index d814a545e..9f284835a 100644 --- a/avalon.js +++ b/avalon.js @@ -1706,13 +1706,13 @@ fixVML(el) } } - if (tag === "tr") { - for (els = wrapper.children, i = 0; el = els[i++]; ) { - // IE6-8,如果动态生成tr元素,必须会在后面添加早已废弃caption的标签,其nodeName,innerHTML都为"" - if (el.nodeName === "") { - el.parentNode.removeChild(el) - i-- - } + } + if (DOC.createStyleSheet && tag === "tr") { + for (els = wrapper.children, i = 0; el = els[i++]; ) { + // IE6-9,如果动态生成tr元素,必须会在后面添加早已废弃caption的标签,其nodeName,innerHTML都为"" + if (el.nodeName === "") { + el.parentNode.removeChild(el) + i-- } } } diff --git a/avalon.min.js b/avalon.min.js index 53f345eda..fe71ce235 100644 --- a/avalon.min.js +++ b/avalon.min.js @@ -44,7 +44,7 @@ arguments.length&&void 0===b)return this;var c=this,d=arguments;return function( b.childNodes)for(var d=b.childNodes,e=0,f;f=d[e++];)if(f.tagName){var g=p.createElementNS("http://www.w3.org/2000/svg",f.tagName.toLowerCase());L.forEach.call(f.attributes,function(b){g.setAttribute(b.name,b.value)});Ka(f,g);c.appendChild(g)}};Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:$a,set:function(b){var c=this.tagName.toLowerCase(),d=this.parentNode;b=avalon.parseHTML(b);"svg"===c?d.insertBefore(b,this):(c=p.createDocumentFragment(),Ka(b,c),d.insertBefore(c, this));d.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var b=RegExp("$","i");return this.outerHTML.replace(RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),"").replace(b,"")},set:function(b){avalon.clearHTML&&(avalon.clearHTML(this),b=avalon.parseHTML(b),Ka(b,this))}}})}}!B.outerHTML&&r.HTMLElement&&HTMLElement.prototype.__defineGetter__("outerHTML",$a);var P,Q,aa,Mb,vb,Nb=/[-.*+?^${}()|[\]\/\\]/g,D=y,U={loader:function(b){r.define= b?D.define:Bc;r.require=b?D:Ac},interpolate:function(b){P=b[0];Q=b[1];if(P===Q)throw new SyntaxError("openTag!==closeTag");if("\x3c!--,--\x3e"===b+"")u.commentInterpolate=!0;else{b=P+"test"+Q;ea.innerHTML=b;if(ea.innerHTML!==b&&0<=ea.innerHTML.indexOf("<"))throw new SyntaxError("\u6b64\u5b9a\u754c\u7b26\u4e0d\u5408\u6cd5");ea.innerHTML=""}b=(P+"").replace(Nb,"\\$&");var c=(Q+"").replace(Nb,"\\$&");aa=RegExp(b+"(.*?)"+c);Mb=RegExp(b+"(.*?)"+c,"g");vb=RegExp(b+".*?"+c+"|\\sms-")}};u.debug=!0;u.plugins= -U;u.plugins.interpolate(["{{","}}"]);u.paths={};u.shim={};u.maxRepeatSize=100;avalon.config=u;var cb={_toString:function(){var b=this.node.className;return("string"===typeof b?b:b.baseVal).split(/\s+/).join(" ")},_contains:function(b){return-1<(" "+this+" ").indexOf(" "+b+" ")},_add:function(b){this.contains(b)||this._set(this+" "+b)},_remove:function(b){this._set((" "+this+" ").replace(" "+b+" "," ").trim())},__set:function(b){var c=this.node;"string"===typeof c.className?c.className=b:c.setAttribute("class", +U;u.plugins.interpolate(["{{","}}"]);u.paths={};u.shim={};u.maxRepeatSize=100;avalon.config=u;var cb={_toString:function(){var b=this.node.className;return("string"===typeof b?b:b.baseVal).split(/\s+/).join(" ")},_contains:function(b){return-1<(" "+this+" ").indexOf(" "+b+" ")},_add:function(b){this.contains(b)||this._set(this+" "+b)},_remove:function(b){this._set((" "+this+" ").replace(" "+b+" "," "))},__set:function(b){b=b.trim();var c=this.node;"string"===typeof c.className?c.className=b:c.setAttribute("class", b)}};"add,remove".replace(z,function(b){avalon.fn[b+"Class"]=function(c){var d=this[0];c&&("string"===typeof c&&d&&1===d.nodeType)&&c.replace(/\S+/g,function(c){bb(d)[b](c)});return this}});avalon.fn.mix({hasClass:function(b){var c=this[0]||{};return 1===c.nodeType&&bb(c).contains(b)},toggleClass:function(b,c){for(var d,e=0,f=b.split(/\s+/),g="boolean"===typeof c;d=f[e++];)this[(g?c:!this.hasClass(d))?"addClass":"removeClass"](d);return this},attr:function(b,c){return 2===arguments.length?(this[0].setAttribute(b, c),this):this[0].getAttribute(b)},data:function(b,c){b="data-"+ab(b||"");switch(arguments.length){case 2:return this.attr(b,c),this;case 1:var d=this.attr(b);return db(d);case 0:var e={};L.forEach.call(this[0].attributes,function(c){c&&(b=c.name,b.indexOf("data-")||(b=oa(b.slice(5)),e[b]=db(c.value)))});return e}},removeData:function(b){b="data-"+ab(b);this[0].removeAttribute(b);return this},css:function(b,c){if(avalon.isPlainObject(b))for(var d in b)avalon.css(this,d,b[d]);else var e=avalon.css(this, b,c);return void 0!==e?e:this},position:function(){var b,c,d=this[0],e={top:0,left:0};if(d)return"fixed"===this.css("position")?c=d.getBoundingClientRect():(b=this.offsetParent(),c=this.offset(),"HTML"!==b[0].tagName&&(e=b.offset()),e.top+=avalon.css(b[0],"borderTopWidth",!0),e.left+=avalon.css(b[0],"borderLeftWidth",!0)),{top:c.top-e.top-avalon.css(d,"marginTop",!0),left:c.left-e.left-avalon.css(d,"marginLeft",!0)}},offsetParent:function(){for(var b=this[0].offsetParent||B;b&&"HTML"!==b.tagName&& @@ -61,16 +61,17 @@ return{top:c.top+h-b,left:c.left+e-g}};var Qc=/^"],param:[1,""],col:[2,"","
"],legend:[1,"
"],option:[1,"