OSDN Git Service

Version 0.6.172, bugfix...
[pettanr/clientJs.git] / 0.6.x / js / 02_dom / 05_XNodeAttr.js
index 9a33207..6dcd5c7 100644 (file)
@@ -86,7 +86,7 @@ function X_Node_Attr_objToAttrText( that, skipNetworkForElmCreation ){
                delete that[ '_newAttrs' ];\r
                // このあとで _newAttr にネットワーク系の属性を控える, attrText には加えない\r
        } else {\r
-               that[ '_flags' ] &= ~X_Node_State.OLD_ATTRTEXT;\r
+               that[ '_flags' ] &= ~X_NodeFlags_OLD_ATTRTEXT;\r
                // 完全な attrText\r
        };\r
        \r
@@ -161,7 +161,7 @@ function X_Node_Attr_objToAttrText( that, skipNetworkForElmCreation ){
  * // setter - 2\r
  * node.attr( 'src', url );\r
  */\r
-Node.prototype[ 'attr' ] = function( nameOrObj /* v */ ){\r
+function X_Node_attr( nameOrObj /* v */ ){\r
        var attrs = this[ '_attrs' ], newAttrs, f, k, elm, v;\r
        \r
        if( !this[ '_tag' ] ) return this;\r
@@ -176,8 +176,8 @@ Node.prototype[ 'attr' ] = function( nameOrObj /* v */ ){
                };\r
                if( f ){\r
                        delete this[ '_attrText' ];\r
-                       this[ '_flags' ] |= X_Node_State.DIRTY_ATTR | X_Node_State.OLD_ATTRTEXT;\r
-                       this[ '_flags' ] & X_Node_State.IN_TREE && X_Node_reserveUpdate();\r
+                       this[ '_flags' ] |= X_NodeFlags_DIRTY_ATTR | X_NodeFlags_OLD_ATTRTEXT;\r
+                       this[ '_flags' ] & X_NodeFlags_IN_TREE && X_Node_reserveUpdate();\r
                };\r
                return this;\r
        } else\r
@@ -185,8 +185,8 @@ Node.prototype[ 'attr' ] = function( nameOrObj /* v */ ){
                // setter\r
                if( X_Node_Attr_setAttr( this, attrs || ( this[ '_attrs' ] = {} ), this[ '_newAttrs' ] || ( this[ '_newAttrs' ] = {} ), nameOrObj, arguments[ 1 ] ) === true ){\r
                        delete this[ '_attrText' ];\r
-                       this[ '_flags' ] |= X_Node_State.DIRTY_ATTR | X_Node_State.OLD_ATTRTEXT;\r
-                       this[ '_flags' ] & X_Node_State.IN_TREE && X_Node_reserveUpdate();\r
+                       this[ '_flags' ] |= X_NodeFlags_DIRTY_ATTR | X_NodeFlags_OLD_ATTRTEXT;\r
+                       this[ '_flags' ] & X_NodeFlags_IN_TREE && X_Node_reserveUpdate();\r
                };\r
                return this;\r
        } else\r
@@ -238,6 +238,16 @@ Node.prototype[ 'attr' ] = function( nameOrObj /* v */ ){
 };\r
 function X_Node_Attr_setAttr( that, attrs, newAttrs, name, v ){\r
        switch( name ){\r
+               case 'ns' :\r
+               case 'NS' :\r
+                       if( v === 'svg' || v === 'SVG' ){\r
+                               that[ '_flags' ] |= X_NodeFlags_IS_SVG;\r
+                       };\r
+                       if( v === 'vml' || v === 'VML' ){\r
+                               that[ '_flags' ] |= X_NodeFlags_IS_VML;\r
+                       };\r
+                       return;\r
+               \r
                // case 'type' : TODO IE は input, button, object に対して type の再設定が出来ない _state が要素生成済なら不可\r
                case 'UID' :\r
                case 'tag' :\r
@@ -248,8 +258,8 @@ function X_Node_Attr_setAttr( that, attrs, newAttrs, name, v ){
                        // TODO unique の check\r
                        if( v !== that[ '_id' ] ){\r
                                that[ '_id' ] = v;\r
-                               that[ '_flags' ] |= X_Node_State.DIRTY_ID;\r
-                               that[ '_flags' ] & X_Node_State.IN_TREE && X_Node_reserveUpdate();\r
+                               that[ '_flags' ] |= X_NodeFlags_DIRTY_ID;\r
+                               that[ '_flags' ] & X_NodeFlags_IN_TREE && X_Node_reserveUpdate();\r
                        };\r
                        return; \r
                case 'class' :\r