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 |
} |
} |
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 |