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