*/
function X_Node_clone( opt_clone_children ){
var xnode, xnodes, i, l;
+
if( this[ '_tag' ] ){
X_Node_newByTag = true;
xnode = Node( this[ '_tag' ], X_Object_copy( this[ '_attrs' ] ), X_Object_copy( this[ '_css' ] ) )
[ 'attr' ]( { 'id' : this[ '_id' ] } )
[ 'className' ]( this[ '_className' ] );
+
+ if( this[ '_flags' ] & X_NodeFlags_IS_SVG ){
+ xnode[ '_flags' ] |= X_NodeFlags_IS_SVG;
+ };
+ if( this[ '_flags' ] & X_NodeFlags_IS_VML ){
+ xnode[ '_flags' ] |= X_NodeFlags_IS_VML;
+ };
+
if( opt_clone_children && ( xnodes = this[ '_xnodes' ] ) && ( l = xnodes.length ) ){
for( i = 0; i < l; ++i ){
xnode[ 'append' ]( xnodes[ i ][ 'clone' ]( true ) );
};
};
- return xnode;
+ return xnode;
};
X_Node_newByText = true;
return Node( this[ '_text' ] );
v[ '_xnodes' ] && X_Node_toggleInTreeFlag( v[ '_xnodes' ], true );
X_Node_reserveUpdate();
};
+ if( this[ '_flags' ] & X_NodeFlags_IS_SVG ){
+ v[ '_flags' ] |= X_NodeFlags_IS_SVG;
+ };
+ if( this[ '_flags' ] & X_NodeFlags_IS_VML ){
+ v[ '_flags' ] |= X_NodeFlags_IS_VML;
+ };
return this;
};
v[ '_xnodes' ] && X_Node_toggleInTreeFlag( v[ '_xnodes' ], true );
X_Node_reserveUpdate();
};
+ if( this[ '_flags' ] & X_NodeFlags_IS_SVG ){
+ v[ '_flags' ] |= X_NodeFlags_IS_SVG;
+ };
+ if( this[ '_flags' ] & X_NodeFlags_IS_VML ){
+ v[ '_flags' ] |= X_NodeFlags_IS_VML;
+ };
return this;
};
return this[ '_text' ];
};
-/*
+/**
* HTML要素に対して name の関数を実行しその戻り値を返す。関数に渡す引数も任意に設定できる。
+ * @alias Node.prototype.call
+ * @param {string} [name] 要素の関数名
+ * @return {*}
+ * @example node.call( 'focus' );
*/
function X_Node_call( name /*, opt_args... */ ){
var l = arguments.length - 1,
that[ '_cssText' ] ? ' style="' + that[ '_cssText' ] + '"' : '',
'>' ].join( '' ) );
} else {
- that[ '_rawObject' ] = elm = document.createElement( that[ '_tag' ] );
+ if( that[ '_flags' ] & X_NodeFlags_IS_SVG ){
+ that[ '_rawObject' ] = elm = document.createElementNS( 'http://www.w3.org/2000/svg', that[ '_tag' ] );
+ } else {
+ that[ '_rawObject' ] = elm = document.createElement( that[ '_tag' ] );
+ };
};
// IE には要素追加のタイミングで起こるメモリリークがありここで追加