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

Contents of /messaging/manakai/lib/Message/DOM/Text.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Sat Jun 16 15:27:45 2007 UTC (17 years, 5 months ago) by wakaba
Branch: MAIN
Changes since 1.2: +9 -13 lines
++ manakai/t/ChangeLog	16 Jun 2007 15:27:38 -0000
	* DOM-Node.t: Tests for |prefix| and |text_content| are added.

2007-06-16  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/Message/DOM/ChangeLog	16 Jun 2007 15:27:12 -0000
	* DOMConfiguration.pm: New module.

	* Attr.pm (trivial accessor for read-write attributes): Throw
	an exception if the node is read-only.  Delete the property
	if undef is specified.
	(prefix): Implemented.

	* DOMElement.pm (trivial accessor for read-write attributes): Throw
        an exception if the node is read-only.  Delete the property
        if undef is specified.
        (prefix): Implemented.
	(text_content, manakai_append_text): Old implementations are removed.

	* DOMCharacterData.pm (text_content): Implemented.

	* DOMDocument.pm (____new): Initialize the strict-document-children
	parameter by true.
	(text_content): Reimplemented.
	(dom_config): New.

	* DOMException.pm (READ_ONLY_NODE_ERR): New subtype.

	* DocumentType.pm (text_content): Implemented.

	* ElementTypeDefinition.pm (text_content): Implemented.

	* Node.pm (___report_error): New method.
	(text_content): Implemented.
	(manakai_append_text): Copied from |DOMElement.pm|.

	* Notation.pm (text_content): Implemented.

	* ProcessingInstruction.pm (text_content): Implemented.

	* Text.pm (is_element_content_whitespace): Alpha version.

2007-06-16  Wakaba  <wakaba@suika.fam.cx>

1 wakaba 1.1 package Message::DOM::Text;
2     use strict;
3 wakaba 1.3 our $VERSION=do{my @r=(q$Revision: 1.2 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
4 wakaba 1.1 push our @ISA, 'Message::DOM::CharacterData', 'Message::IF::Text';
5     require Message::DOM::DOMCharacterData; ## TODO: Change to new module name
6    
7     sub AUTOLOAD {
8     my $method_name = our $AUTOLOAD;
9     $method_name =~ s/.*:://;
10     return if $method_name eq 'DESTROY';
11    
12     if ({
13     ## Read-only attributes (trivial accessors)
14     }->{$method_name}) {
15     no strict 'refs';
16     eval qq{
17     sub $method_name (\$) {
18     if (\@_ > 1) {
19     require Carp;
20     Carp::croak (qq<Can't modify read-only attribute>);
21     }
22     return \${\$_[0]}->{$method_name};
23     }
24     };
25     goto &{ $AUTOLOAD };
26     } elsif ({
27     ## Read-write attributes (DOMString, trivial accessors)
28     }->{$method_name}) {
29     no strict 'refs';
30     eval qq{
31     sub $method_name (\$) {
32     if (\@_ > 1) {
33     \${\$_[0]}->{$method_name} = ''.$_[1];
34     }
35     return \${\$_[0]}->{$method_name};
36     }
37     };
38     goto &{ $AUTOLOAD };
39     } else {
40     require Carp;
41     Carp::croak (qq<Can't locate method "$AUTOLOAD">);
42     }
43     } # AUTOLOAD
44    
45 wakaba 1.3 ## |Node| attributes
46 wakaba 1.1
47 wakaba 1.3 sub node_name () { '#text' }
48 wakaba 1.2
49 wakaba 1.3 sub node_type { 3 } # TEXT_NODE
50 wakaba 1.2
51 wakaba 1.3 sub is_element_content_whitespace ($;$) {
52     ## TODO:
53     return 0;
54     } # is_element_content_whitespace
55 wakaba 1.1
56     package Message::IF::Text;
57    
58     package Message::DOM::Document;
59    
60     sub create_text_node ($$) {
61     return Message::DOM::Text->____new ($_[0], $_[1]);
62     } # create_text_node
63    
64     1;
65     ## License: <http://suika.fam.cx/~wakaba/archive/2004/8/18/license#Perl+MPL>
66 wakaba 1.3 ## $Date: 2007/06/15 14:32:50 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24