OSDN Git Service

Version 0.6.114, add AudioSprite, etc.
[pettanr/clientJs.git] / 0.6.x / js / 02_dom / 05_XNodeAttr.js
index 1864969..5a5f16f 100644 (file)
@@ -45,7 +45,9 @@ X_Node_Attr_HAS_VALUE = {
                INPUT    : true,\r
                TEXTAREA : true,\r
                SELECT   : true,\r
-               BUTTON   : true\r
+               BUTTON   : true,\r
+               OBJECT   : true,\r
+               PARAM    : true // FlashVars が flash 側から書き換えられるケースがある\r
 },\r
 \r
 X_Node_Attr_renameForTag = {};\r
@@ -126,9 +128,17 @@ Node.prototype.attr = function( nameOrObj /* v */ ){
                        case 'style' :\r
                        case 'cssText' :\r
                                return this.cssText();\r
+                       case 'text' :\r
+                               return this.text();\r
+                       case 'html' :\r
+                               return this.html();\r
+                       case 'selected' :\r
+                               // kquery.js : safariのバグ対策\r
+                               // if ($.browser.safari && key === "selected" && tmp) tmp.selectedIndex;\r
+                               // 親ノードの selectedIndex の getter を呼んでおくと値が正しくなる、ということ?( by itozyun )\r
+                               if( X_UA.WebKit ) this._rawObject.parentNode.selectedIndex;\r
                        case 'value' :\r
                        case 'checked' :\r
-                       case 'selected' :\r
                        case 'disabled' :                       \r
                        case 'selectedIndex' :\r
                                if( X_Node_Attr_HAS_VALUE[ this._tag ] ){\r
@@ -164,6 +174,10 @@ function X_Node_Attr_setAttr( that, attrs, newAttrs, name, v ){
                case 'style' :\r
                case 'cssText' :\r
                        return that.cssText( v );\r
+               case 'text' :\r
+                       return that.text( v );\r
+               case 'html' :\r
+                       return that.html( v );\r
        };\r
        // debug\r
        if( name.indexOf( 'on' ) === 0 ){\r