/[suikacvs]/messaging/manakai/lib/Message/DOM/Attr.pm
Suika

Diff of /messaging/manakai/lib/Message/DOM/Attr.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by wakaba, Sat Jun 16 08:05:48 2007 UTC revision 1.5 by wakaba, Sat Jun 16 15:27:45 2007 UTC
# Line 37  sub AUTOLOAD { Line 37  sub AUTOLOAD {
37    }->{$method_name}) {    }->{$method_name}) {
38      no strict 'refs';      no strict 'refs';
39      eval qq{      eval qq{
40        sub $method_name (\$) {        sub $method_name (\$;\$) {
41          if (\@_ > 1) {          if (\@_ > 1) {
42            \${\$_[0]}->{$method_name} = ''.\$_[1];            if (\${\$_[0]}->{manakai_read_only}) {
43                report Message::DOM::DOMException
44                    -object => \$_[0],
45                    -type => 'NO_MODIFICATION_ALLOWED_ERR',
46                    -subtype => 'READ_ONLY_NODE_ERR';
47              }
48              if (defined \$_[1]) {
49                \${\$_[0]}->{$method_name} = ''.\$_[1];
50              } else {
51                delete \${\$_[0]}->{$method_name};
52              }
53          }          }
54          return \${\$_[0]}->{$method_name};          return \${\$_[0]}->{$method_name};
55        }        }
# Line 78  sub node_type () { 2 } # ATTRIBUTE_NODE Line 88  sub node_type () { 2 } # ATTRIBUTE_NODE
88  *node_value = \&value;  *node_value = \&value;
89    
90  sub prefix ($;$) {  sub prefix ($;$) {
91    ## TODO: setter    ## NOTE: No check for new value as Firefox doesn't do.
92    return ${+shift}->{prefix};    ## See <http://suika.fam.cx/gate/2005/sw/prefix>.
93    
94      ## NOTE: Same as trivial setter except "" -> undef
95    
96      ## NOTE: Same as |Element|'s |prefix|.
97      
98      if (@_ > 1) {
99        if (${$_[0]}->{manakai_read_only}) {
100          report Message::DOM::DOMException
101              -object => $_[0],
102              -type => 'NO_MODIFICATION_ALLOWED_ERR',
103              -subtype => 'READ_ONLY_NODE_ERR';
104        }
105        if (defined $_[1] and $_[1] ne '') {
106          ${$_[0]}->{prefix} = ''.$_[1];
107        } else {
108          delete ${$_[0]}->{prefix};
109        }
110      }
111      return ${$_[0]}->{prefix};
112  } # prefix  } # prefix
113    
114  ## The |Attr| interface - attribute  ## The |Attr| interface - attribute

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24