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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Sun Jun 17 13:37:40 2007 UTC (17 years, 5 months ago) by wakaba
Branch: MAIN
Changes since 1.3: +3 -10 lines
++ manakai/t/ChangeLog	17 Jun 2007 13:37:22 -0000
2007-06-17  Wakaba  <wakaba@suika.fam.cx>

	* DOM-Attr.t, DOM-AttributeDefinition.t, DOM-DocumentType.t,
	DOM-Element.t, DOM-Entity.t, DOM-EntityReference.t,
	DOM-Notation.t, DOM-ProcessingInstruction.t: New.

	* DOM-Document.t, DOM-Node.t: Tests for newly-implemented attributes
	and methods are added.

	* Makefile (test-module-dom-old): Renamed from |test-module-dom|.
	(test-module-dom): New.

++ manakai/lib/Message/DOM/ChangeLog	17 Jun 2007 13:34:54 -0000
2007-06-17  Wakaba  <wakaba@suika.fam.cx>

	* Attr.pm (____new): Initialize |specified| as 1.
	(base_uri, manakai_attribute_type, specified): Implemented.
	(prefix): Don't check read-only flag unless |strict_error_checking|.
	(value): Call |text_content| for now.

	* AttributeDefinition.pm (DeclaredValueType, DefaultValueType): Added.
	(declared_type, default_type): Implemented.

	* CharacterData.pm (____new): Allow a scalar reference
	as an input for the |data| attribute.
	(base_uri, manakai_append_text): Implemented.

	* DOMConfiguration.pm (set_parameter): Resetting implemented.

	* DOMDocument.pm (____new): Set default values to
	configuration parameter whose default is true.
	(document_uri, input_encoding): Implemented.
	(all_declarations_processed, manakai_is_html): Implemented.
	(base_uri, manakai_append_text,
	manakai_entity_base_uri, strict_error_checking,
	xml_encoding, xml_version, xml_standalone): Implemented.

	* DOMElement.pm (manakai_base_uri, base_uri): Implemented.
	(get_attribute, get_attribute_node): Alpha version.
	(set_attribute_node, set_attribute_node_ns): Implemented.
	(set_attribute_ns): Accept non-ARRAY qualified name.

	* DOMException.pm (___error_def): |WRONG_DOCUMENT_ERR|,
	|NOT_SUPPORTED_ERR|, and |INUSE_ATTRIBUTE_ERR| are added.

	* DocumentType.pm (public_id, system_id): Implemented.
	(base_uri, declaration_base_uri, manakai_declaration_base_uri,
	manakai_append_text): Implemented.
	(element_types, general_entities, notations,
	set_element_type_definition_node, set_general_entity_node,
	set_notation_node): Alpha version.

	* ElementTypeDefinition.pm (manakai_append_text): Implemented.
	(attribute_definitions, set_attribute_definition_node): Alpha version.

	* Entity.pm (has_replacement_tree, public_id, system_id,
	manakai_declaration_base_uri, manakai_entity_base_uri,
	manakai_entity_uri): Implemented.

	* EntityReference.pm (manakai_expanded, manakai_external): Implemented.
	(base_uri, manakai_entity_base_uri): Implemented.

	* Node.pm (base_uri): Implemented.
	(text_content): Don't check read-only or not
	unless |strict_error_checking|.
	(manakai_append_text): Implemented.
	(get_feature): Alpha.
	(manakai_set_read_only): Implemented.

	* Notation.pm (public_id, system_id, manakai_append_text,
	manakai_declaration_base_uri): Implemented.

	* ProcessingInstruction.pm (manakai_base_uri,
	base_uri, manakai_append_text): Implemented.

1 wakaba 1.1 package Message::DOM::DocumentFragment;
2     use strict;
3 wakaba 1.4 our $VERSION=do{my @r=(q$Revision: 1.3 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
4 wakaba 1.1 push our @ISA, 'Message::DOM::Node', 'Message::IF::DocumentFragment';
5     require Message::DOM::Node;
6    
7     sub ____new ($$) {
8     my $self = shift->SUPER::____new (shift);
9 wakaba 1.3 $$self->{child_nodes} = [];
10 wakaba 1.1 return $self;
11     } # ____new
12    
13     sub AUTOLOAD {
14     my $method_name = our $AUTOLOAD;
15     $method_name =~ s/.*:://;
16     return if $method_name eq 'DESTROY';
17    
18     if ({
19     ## Read-only attributes (trivial accessors)
20     }->{$method_name}) {
21     no strict 'refs';
22     eval qq{
23     sub $method_name (\$) {
24     if (\@_ > 1) {
25     require Carp;
26     Carp::croak (qq<Can't modify read-only attribute>);
27     }
28     return \${\$_[0]}->{$method_name};
29     }
30     };
31     goto &{ $AUTOLOAD };
32     } elsif ({
33     ## Read-write attributes (DOMString, trivial accessors)
34     }->{$method_name}) {
35     no strict 'refs';
36     eval qq{
37     sub $method_name (\$) {
38     if (\@_ > 1) {
39     \${\$_[0]}->{$method_name} = ''.$_[1];
40     }
41     return \${\$_[0]}->{$method_name};
42     }
43     };
44     goto &{ $AUTOLOAD };
45     } else {
46     require Carp;
47     Carp::croak (qq<Can't locate method "$AUTOLOAD">);
48     }
49     } # AUTOLOAD
50    
51 wakaba 1.4 ## |Node| attributes
52 wakaba 1.2
53     sub node_name ($) {
54     return '#document-fragment';
55     } # node_name
56    
57     ## Spec:
58     ## <http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-111237558>
59    
60     sub node_type ($) { 11 } # DOCUMENT_FRAGMENT_NODE
61 wakaba 1.1
62     package Message::IF::DocumentFragment;
63    
64     package Message::DOM::Document;
65    
66     ## Spec:
67     ## <http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-35CB04B5>
68    
69 wakaba 1.2 sub create_document_fragment ($) {
70 wakaba 1.1 return Message::DOM::DocumentFragment->____new ($_[0]);
71     } # create_document_fragment
72    
73     1;
74     ## License: <http://suika.fam.cx/~wakaba/archive/2004/8/18/license#Perl+MPL>
75 wakaba 1.4 ## $Date: 2007/06/16 08:05:48 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24