OSDN Git Service

Version 0.6.30, bugfix.
authoritozyun <itozyun@user.sourceforge.jp>
Tue, 18 Mar 2014 21:40:22 +0000 (06:40 +0900)
committeritozyun <itozyun@user.sourceforge.jp>
Tue, 18 Mar 2014 21:40:22 +0000 (06:40 +0900)
0.6.x/js/dom/11_XDomNode.js
0.6.x/js/dom/14_XDomAttr.js
0.6.x/js/dom/15_XDomStyle.js

index d2d22c6..c5a562c 100644 (file)
@@ -357,11 +357,11 @@ Node.prototype.append = function( v ){
                                //} else {\r
                                        \r
                                //};\r
-                       } else\r
-                       if( ( i = Node._reserveRemoval.indexOf( v ) ) !== -1 ){\r
-                               if( !this._state ) alert( 'xnode already destroyed!' );\r
-                               Node._reserveRemoval.splice( i, 1 );\r
-                       };\r
+                       };// else\r
+                       //if( ( i = Node._reserveRemoval.indexOf( v ) ) !== -1 ){\r
+                       //      if( !this._state ) alert( 'xnode already destroyed!' );\r
+                       //      Node._reserveRemoval.splice( i, 1 );\r
+                       //};\r
                        break;\r
                default :\r
                        return this;\r
@@ -421,11 +421,11 @@ Node.prototype.appendAt = function( start, v ){
                                //} else {\r
                                        \r
                                //};\r
-                       } else\r
-                       if( ( i = Node._reserveRemoval.indexOf( v ) ) !== -1 ){\r
-                               if( !this._state ) alert( 'xnode already destroyed!' );\r
-                               Node._reserveRemoval.splice( i, 1 );\r
-                       };\r
+                       };// else\r
+                       //if( ( i = Node._reserveRemoval.indexOf( v ) ) !== -1 ){\r
+                       //      if( !this._state ) alert( 'xnode already destroyed!' );\r
+                       //      Node._reserveRemoval.splice( i, 1 );\r
+                       //};\r
                        break;\r
                default :\r
                        return this;\r
@@ -720,7 +720,7 @@ Node.prototype.hasClass = function( v ){
 Node._outerFlag = null;\r
 \r
 Node.prototype.html = function( html ){\r
-       var _ = '', xnodes, n, i, l;\r
+       var _ = '', q = '"', xnodes, n, i, l;\r
        // setter\r
        if( X.Type.isString( html ) ){\r
                if( this._xnodeType === 3 ) return this.text( html );\r
@@ -737,10 +737,10 @@ Node.prototype.html = function( html ){
        };\r
        html = !Node._outerFlag ? [] : [\r
                '<', this._tag,\r
-               this._id ? ' id="' + this._id + '"' : _,\r
-               this._className ? ' class="' + this._className + '"' : _,\r
+               this._id ? ' id="' + this._id + q : _,\r
+               this._className ? ' class="' + this._className + q : _,\r
                this._attrText || ( this._attrText = X.Dom.Attr.objToAttrText( this._attrs ) ),\r
-               this._cssText ? ' style="' + this._cssText + '"' : _,\r
+               this._cssText ? ' style="' + this._cssText + q : _,\r
        '>' ];\r
        \r
        n = html.length;\r
@@ -768,7 +768,8 @@ Node.prototype.text = function( text ){
                        };\r
                        return this;\r
                };\r
-               text ? this.empty().createText( text ) : this.empty();\r
+               if( !text ) return this.empty();\r
+               this.empty().createText( text );\r
                return this;\r
        };\r
        // getter\r
@@ -820,7 +821,6 @@ Node.prototype._startUpdate = function(){
                return;\r
        };\r
 \r
-\r
        X.Dom._listeners && X.Dom._listeners[ X.Dom.Event.BEFORE_UPDATE ] && X.Dom.dispatch( { type : X.Dom.Event.BEFORE_UPDATE } );\r
 \r
        removal = Node._reserveRemoval;\r
@@ -837,7 +837,7 @@ Node.prototype._startUpdate = function(){
                removal.length = 0;             \r
        };\r
        \r
-       this._commitUpdate();\r
+       Node._html._dirty ? Node._html._commitUpdate() : this._commitUpdate();\r
        \r
        X.Dom._listeners && X.Dom._listeners[ X.Dom.Event.AFTER_UPDATE ] && X.Dom.dispatch( { type : X.Dom.Event.AFTER_UPDATE } );\r
        //this._rawNode.style.visibility = tmp;\r
@@ -949,7 +949,7 @@ Node.prototype._updateRawNode =
                        };\r
                        // className\r
                        if( this._dirty & X.Dom.Dirty.CLASSNAME ){\r
-                               if( X.UA.IE && X.UA.IE < 7 ){\r
+                               if( X.UA.IE && X.UA.IE < 8 ){\r
                                        elm.className = this._className;\r
                                        // ie5 only\r
                                        if( X.Dom.State.IE5_DISPLAY_NONE_FIX && elm.currentStyle.display === 'none' ){\r
@@ -1184,7 +1184,7 @@ Node.prototype._afterActualCreate =
                                elm.style.filter = X.Dom.Style.SPECIAL_FIX( this._css );\r
                                delete this._dirty;\r
                        };\r
-                       this._restoreEvent();// イベントの復帰\r
+                       \r
                        delete this._isNew;\r
                } else {\r
                        this._dirty && this._updateRawNode( elm );\r
@@ -1196,7 +1196,7 @@ Node.prototype._afterActualCreate =
                        };\r
                };\r
                \r
-               return this;\r
+               this._restoreEvent();// イベントの復帰\r
        }) :\r
        document.all ? (function(){\r
                var xnodes, i;\r
@@ -1209,11 +1209,12 @@ Node.prototype._afterActualCreate =
                                xnodes[ --i ]._afterActualCreate();\r
                        };\r
                };\r
+               // textarea への value の適用はここで\r
                if( this._dirty & X.Dom.Dirty.IE_FILTER ){\r
                        this._ie4getRawNode().style.filter = X.Dom.Style.SPECIAL_FIX( this._css );\r
                };\r
                delete this._dirty;\r
-               return this._restoreEvent();// イベントの復帰\r
+               this._restoreEvent();// イベントの復帰\r
        }) :\r
        (function(){});\r
 \r
index bcbe0d6..a67c7df 100644 (file)
@@ -178,9 +178,13 @@ X.Dom.Attr = {
        // 先頭にスペース\r
        objToAttrText : function( obj ){\r
                var noValue = X.Dom.Attr.noValue,\r
-                       attrs = [ '' ], n = 0, p;\r
+                       attrs = [ '' ], n = 0, p, v;\r
                for( p in obj ){\r
-                       attrs[ ++n ] = noValue[ p ] ? p : [ p, '="', obj[ p ], '"' ].join( '' );\r
+                       v = obj[ p ];\r
+                       if( p === 'value' ){\r
+                               v = v.split( '"' ).join( '&quot;' ).split( '>' ).join( '&gt;' ).split( '<' ).join( '&lt;' );\r
+                       };\r
+                       attrs[ ++n ] = noValue[ p ] ? p : [ p, '="', v, '"' ].join( '' );\r
                };\r
                return 0 < n ? attrs.join( ' ' ) : '';\r
        }\r
index 7cb0410..9b747d4 100644 (file)
@@ -1093,7 +1093,7 @@ X.Dom.Node.prototype._getCharSize =
                }) :
        X.UA.IE ?
                (function(){
-                       var elm = this._rawNode, v;
+                       var elm = this._rawNode || this._ie4getRawNode(), v;
                        elm.insertAdjacentHTML( 'BeforeEnd', '<span style="visivility:hidden;line-height:1;">X</span>' );
                        elm = elm.children[ elm.children.length - 1 ];
                        v   = elm.offsetHeight;
@@ -1105,7 +1105,7 @@ X.Dom.Node.prototype._getCharSize =
 
 
 X.Dom.listenOnce( X.Dom.Event.DOM_PRE_INIT, function(){
-       var testStyle = X.Dom._root.style;
+       var testStyle = X.Dom._root;//.style;
        
        X.Dom.Style.VENDER_PREFIX = (function(){
                var ret       = {},