1 |
wakaba |
1.1 |
#!/usr/bin/perl |
2 |
|
|
## This file is automatically generated |
3 |
wakaba |
1.13 |
## at 2006-12-30T14:36:51+00:00, |
4 |
|
|
## from file "../DOM/CharacterData.dis", |
5 |
wakaba |
1.1 |
## module <http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.CharacterData>, |
6 |
wakaba |
1.12 |
## for <http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#all>. |
7 |
wakaba |
1.1 |
## Don't edit by hand! |
8 |
|
|
use strict; |
9 |
|
|
require Message::DOM::DOMCore; |
10 |
wakaba |
1.7 |
require Message::DOM::Document; |
11 |
wakaba |
1.1 |
require Message::DOM::TreeCore; |
12 |
|
|
require Message::Util::Error::DOMException; |
13 |
|
|
package Message::DOM::CharacterData; |
14 |
wakaba |
1.13 |
our $VERSION = 20061230.1436; |
15 |
wakaba |
1.7 |
package Message::DOM::CharacterData::ManakaiDOMDocumentCharacterData; |
16 |
wakaba |
1.13 |
our $VERSION = 20061230.1436; |
17 |
wakaba |
1.7 |
push @Message::DOM::Document::ManakaiDOMDocument::ISA, q<Message::DOM::CharacterData::ManakaiDOMDocumentCharacterData> unless Message::DOM::Document::ManakaiDOMDocument->isa (q<Message::DOM::CharacterData::ManakaiDOMDocumentCharacterData>); |
18 |
|
|
sub create_text_node ($$) { |
19 |
|
|
my ($self, $data) = @_; |
20 |
|
|
my $r; |
21 |
|
|
|
22 |
|
|
{ |
23 |
|
|
|
24 |
|
|
|
25 |
wakaba |
1.11 |
$r = bless \{ |
26 |
wakaba |
1.7 |
|
27 |
wakaba |
1.10 |
'od' |
28 |
|
|
=> $self, |
29 |
wakaba |
1.7 |
|
30 |
wakaba |
1.10 |
'con' |
31 |
|
|
=> \$data, |
32 |
wakaba |
1.11 |
}, |
33 |
wakaba |
1.10 |
'Message::DOM::CharacterData::ManakaiDOMText' |
34 |
|
|
; |
35 |
|
|
Scalar::Util::weaken ($$r->{ |
36 |
|
|
'od' |
37 |
|
|
}); |
38 |
wakaba |
1.7 |
|
39 |
|
|
|
40 |
|
|
} |
41 |
|
|
$r} |
42 |
|
|
sub create_comment ($$) { |
43 |
|
|
my ($self, $data) = @_; |
44 |
|
|
my $r; |
45 |
|
|
|
46 |
|
|
{ |
47 |
|
|
|
48 |
|
|
|
49 |
wakaba |
1.10 |
$r = bless \{ |
50 |
wakaba |
1.7 |
|
51 |
wakaba |
1.10 |
'od' |
52 |
|
|
=> $self, |
53 |
wakaba |
1.7 |
|
54 |
wakaba |
1.10 |
'con' |
55 |
|
|
=> \$data, |
56 |
|
|
}, |
57 |
|
|
'Message::DOM::CharacterData::ManakaiDOMComment' |
58 |
|
|
; |
59 |
|
|
Scalar::Util::weaken ($$r->{ |
60 |
|
|
'od' |
61 |
|
|
}); |
62 |
wakaba |
1.7 |
|
63 |
|
|
|
64 |
|
|
} |
65 |
|
|
$r} |
66 |
|
|
$Message::DOM::DOMFeature::ClassInfo->{q<Message::DOM::CharacterData::ManakaiDOMDocumentCharacterData>}->{has_feature} = {}; |
67 |
|
|
$Message::DOM::ClassPoint{q<Message::DOM::CharacterData::ManakaiDOMDocumentCharacterData>} = 0; |
68 |
wakaba |
1.12 |
package Message::DOM::IF::CharacterData; |
69 |
wakaba |
1.13 |
our $VERSION = 20061230.1436; |
70 |
wakaba |
1.1 |
package Message::DOM::CharacterData::ManakaiDOMCharacterData; |
71 |
wakaba |
1.13 |
our $VERSION = 20061230.1436; |
72 |
wakaba |
1.1 |
push our @ISA, 'Message::DOM::TreeCore::ManakaiDOMNode', |
73 |
wakaba |
1.12 |
'Message::DOM::IF::CharacterData', |
74 |
|
|
'Message::DOM::IF::Node', |
75 |
|
|
'Message::DOM::IF::StringExtended'; |
76 |
wakaba |
1.2 |
use Message::Util::Error; |
77 |
wakaba |
1.1 |
sub child_nodes ($;$) { |
78 |
|
|
if (@_ == 1) {my ($self) = @_; |
79 |
|
|
my $r; |
80 |
|
|
|
81 |
|
|
{ |
82 |
|
|
|
83 |
|
|
|
84 |
|
|
{ |
85 |
|
|
|
86 |
|
|
|
87 |
|
|
$r = bless [], |
88 |
|
|
'Message::DOM::TreeCore::ManakaiDOMEmptyNodeList' |
89 |
|
|
; |
90 |
|
|
|
91 |
|
|
|
92 |
|
|
} |
93 |
|
|
|
94 |
|
|
; |
95 |
|
|
|
96 |
|
|
|
97 |
|
|
} |
98 |
|
|
$r; |
99 |
|
|
} else {my ($self) = @_; |
100 |
|
|
report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'child_nodes'; |
101 |
|
|
} |
102 |
|
|
} |
103 |
|
|
sub append_child ($$) { |
104 |
|
|
my ($self, $newChild) = @_; |
105 |
|
|
my $r; |
106 |
|
|
|
107 |
|
|
{ |
108 |
|
|
|
109 |
|
|
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'append_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; |
110 |
|
|
|
111 |
|
|
; |
112 |
|
|
|
113 |
|
|
|
114 |
|
|
} |
115 |
|
|
$r} |
116 |
|
|
sub insert_before ($$;$) { |
117 |
|
|
my ($self, $newChild, $refChild) = @_; |
118 |
|
|
my $r; |
119 |
|
|
|
120 |
|
|
{ |
121 |
|
|
|
122 |
|
|
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'insert_before', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; |
123 |
|
|
|
124 |
|
|
; |
125 |
|
|
|
126 |
|
|
|
127 |
|
|
} |
128 |
|
|
$r} |
129 |
|
|
sub replace_child ($$$) { |
130 |
|
|
my ($self, $newChild, $oldChild) = @_; |
131 |
|
|
my $r; |
132 |
|
|
|
133 |
|
|
{ |
134 |
|
|
|
135 |
|
|
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'HIERARCHY_REQUEST_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_child', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#HIERARCHY_BAD_TYPE', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'newChild', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#node' => $newChild; |
136 |
|
|
|
137 |
|
|
; |
138 |
|
|
|
139 |
|
|
|
140 |
|
|
} |
141 |
|
|
$r} |
142 |
|
|
sub manakai_append_text ($$) { |
143 |
|
|
my ($self, $string) = @_; |
144 |
|
|
my $r; |
145 |
|
|
|
146 |
|
|
{ |
147 |
|
|
|
148 |
|
|
|
149 |
|
|
{ |
150 |
|
|
|
151 |
|
|
local $Error::Depth = $Error::Depth + 1; |
152 |
|
|
|
153 |
|
|
{ |
154 |
|
|
|
155 |
|
|
|
156 |
|
|
if |
157 |
|
|
($self-> |
158 |
|
|
owner_document |
159 |
|
|
|
160 |
|
|
-> |
161 |
|
|
strict_error_checking and |
162 |
|
|
|
163 |
|
|
$self-> |
164 |
|
|
manakai_read_only |
165 |
|
|
) { |
166 |
|
|
|
167 |
|
|
|
168 |
|
|
{ |
169 |
|
|
|
170 |
|
|
local $Error::Depth = $Error::Depth - 1; |
171 |
|
|
|
172 |
|
|
{ |
173 |
|
|
|
174 |
|
|
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'manakai_append_text', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData'; |
175 |
|
|
|
176 |
|
|
|
177 |
|
|
} |
178 |
|
|
|
179 |
|
|
|
180 |
|
|
;} |
181 |
|
|
|
182 |
|
|
; |
183 |
|
|
} |
184 |
wakaba |
1.10 |
my $v = $$self->{ |
185 |
|
|
'con' |
186 |
|
|
}; |
187 |
wakaba |
1.1 |
$$v .= ref $string eq 'SCALAR' ? $$string : $string; |
188 |
|
|
$r = $self; |
189 |
|
|
|
190 |
|
|
|
191 |
|
|
|
192 |
|
|
} |
193 |
|
|
|
194 |
|
|
|
195 |
|
|
;} |
196 |
|
|
|
197 |
|
|
; |
198 |
|
|
|
199 |
|
|
|
200 |
|
|
} |
201 |
|
|
$r} |
202 |
|
|
sub node_value ($;$) { |
203 |
|
|
if (@_ == 1) {my ($self) = @_; |
204 |
wakaba |
1.9 |
my $r = ''; |
205 |
wakaba |
1.1 |
|
206 |
|
|
{ |
207 |
|
|
|
208 |
|
|
|
209 |
wakaba |
1.10 |
$r = ${$$self->{ |
210 |
|
|
'con' |
211 |
|
|
}}; |
212 |
wakaba |
1.1 |
|
213 |
|
|
|
214 |
|
|
} |
215 |
|
|
$r; |
216 |
|
|
} else {my ($self, $given) = @_; |
217 |
|
|
|
218 |
|
|
{ |
219 |
|
|
|
220 |
|
|
|
221 |
|
|
{ |
222 |
|
|
|
223 |
|
|
if |
224 |
|
|
($self-> |
225 |
|
|
manakai_read_only |
226 |
|
|
) { |
227 |
|
|
|
228 |
wakaba |
1.12 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError'; |
229 |
wakaba |
1.1 |
|
230 |
|
|
; |
231 |
|
|
} |
232 |
|
|
|
233 |
|
|
|
234 |
|
|
} |
235 |
|
|
|
236 |
|
|
; |
237 |
wakaba |
1.10 |
my $v = $$self->{ |
238 |
|
|
'con' |
239 |
|
|
}; |
240 |
wakaba |
1.1 |
$$v = defined $given ? $given : ''; |
241 |
|
|
## NOTE: Setting NULL is supported for |
242 |
|
|
## compatibility with |textContent|. |
243 |
|
|
|
244 |
|
|
|
245 |
|
|
} |
246 |
|
|
} |
247 |
|
|
} |
248 |
|
|
sub text_content ($;$) { |
249 |
|
|
if (@_ == 1) {my ($self) = @_; |
250 |
wakaba |
1.9 |
my $r = ''; |
251 |
wakaba |
1.1 |
|
252 |
|
|
{ |
253 |
|
|
|
254 |
|
|
|
255 |
wakaba |
1.10 |
$r = ${$$self->{ |
256 |
|
|
'con' |
257 |
|
|
}}; |
258 |
wakaba |
1.1 |
|
259 |
|
|
|
260 |
|
|
} |
261 |
|
|
$r; |
262 |
|
|
} else {my ($self, $given) = @_; |
263 |
|
|
|
264 |
|
|
{ |
265 |
|
|
|
266 |
|
|
|
267 |
|
|
{ |
268 |
|
|
|
269 |
|
|
if |
270 |
|
|
($self-> |
271 |
|
|
manakai_read_only |
272 |
|
|
) { |
273 |
|
|
|
274 |
wakaba |
1.12 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError'; |
275 |
wakaba |
1.1 |
|
276 |
|
|
; |
277 |
|
|
} |
278 |
|
|
|
279 |
|
|
|
280 |
|
|
} |
281 |
|
|
|
282 |
|
|
; |
283 |
wakaba |
1.10 |
my $v = $$self->{ |
284 |
|
|
'con' |
285 |
|
|
}; |
286 |
wakaba |
1.1 |
$$v = defined $given ? $given : ''; |
287 |
|
|
## NOTE: Setting NULL is supported for |
288 |
|
|
## compatibility with |textContent|. |
289 |
|
|
|
290 |
|
|
|
291 |
|
|
} |
292 |
|
|
} |
293 |
|
|
} |
294 |
|
|
sub base_uri ($;$) { |
295 |
|
|
if (@_ == 1) {my ($self) = @_; |
296 |
wakaba |
1.9 |
my $r = ''; |
297 |
wakaba |
1.1 |
|
298 |
|
|
{ |
299 |
|
|
|
300 |
|
|
|
301 |
|
|
{ |
302 |
|
|
|
303 |
|
|
local $Error::Depth = $Error::Depth + 1; |
304 |
|
|
|
305 |
|
|
{ |
306 |
|
|
|
307 |
|
|
|
308 |
|
|
my |
309 |
|
|
$pe = $self-> |
310 |
|
|
parent_node |
311 |
|
|
; |
312 |
|
|
W: { |
313 |
|
|
while (defined $pe) { |
314 |
|
|
my $nt = $pe-> |
315 |
|
|
node_type |
316 |
|
|
; |
317 |
|
|
if ($nt == |
318 |
wakaba |
1.5 |
1 or |
319 |
wakaba |
1.1 |
|
320 |
|
|
$nt == |
321 |
wakaba |
1.5 |
2 or |
322 |
wakaba |
1.1 |
|
323 |
|
|
$nt == |
324 |
wakaba |
1.5 |
9 or |
325 |
wakaba |
1.1 |
|
326 |
|
|
$nt == |
327 |
wakaba |
1.5 |
11 or |
328 |
wakaba |
1.1 |
|
329 |
|
|
$nt == |
330 |
wakaba |
1.5 |
6 |
331 |
wakaba |
1.1 |
) { |
332 |
|
|
$r = $pe-> |
333 |
|
|
base_uri |
334 |
|
|
; |
335 |
|
|
last W; |
336 |
|
|
} elsif ($nt == |
337 |
wakaba |
1.5 |
5 |
338 |
wakaba |
1.1 |
) { |
339 |
|
|
if ($pe-> |
340 |
|
|
manakai_external |
341 |
|
|
) { |
342 |
|
|
$r = $pe-> |
343 |
|
|
manakai_entity_base_uri |
344 |
|
|
; |
345 |
|
|
last W; |
346 |
|
|
} |
347 |
|
|
} |
348 |
|
|
$pe = $pe-> |
349 |
|
|
parent_node |
350 |
|
|
; |
351 |
|
|
} |
352 |
|
|
if ($pe) { |
353 |
|
|
$r = $pe-> |
354 |
|
|
base_uri |
355 |
|
|
; |
356 |
|
|
} else { |
357 |
|
|
$r = $self-> |
358 |
|
|
owner_document |
359 |
|
|
-> |
360 |
|
|
base_uri |
361 |
|
|
; |
362 |
|
|
} |
363 |
|
|
} # W |
364 |
|
|
|
365 |
|
|
|
366 |
|
|
|
367 |
|
|
} |
368 |
|
|
|
369 |
|
|
|
370 |
|
|
;} |
371 |
|
|
|
372 |
|
|
; |
373 |
|
|
|
374 |
|
|
|
375 |
|
|
} |
376 |
|
|
$r; |
377 |
|
|
} else {my ($self) = @_; |
378 |
|
|
report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'base_uri'; |
379 |
|
|
} |
380 |
|
|
} |
381 |
|
|
sub find_offset16 ($$) { |
382 |
|
|
my ($self, $offset32) = @_; |
383 |
|
|
my $r = 0; |
384 |
|
|
|
385 |
|
|
{ |
386 |
|
|
|
387 |
|
|
my |
388 |
wakaba |
1.10 |
$v = $$self->{ |
389 |
|
|
'con' |
390 |
|
|
}; |
391 |
wakaba |
1.1 |
|
392 |
|
|
if (not defined $offset32 or $offset32 < 0 or |
393 |
|
|
CORE::length ($$v) < $offset32) { |
394 |
|
|
|
395 |
|
|
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#index' => $offset32, '-type' => 'INDEX_SIZE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'find_offset16', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#StringIndexOutOfBoundsException', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'offset32'; |
396 |
|
|
|
397 |
|
|
; |
398 |
|
|
} |
399 |
|
|
|
400 |
|
|
my $ss = substr $$v, 0, $offset32; |
401 |
|
|
$r = $offset32; |
402 |
|
|
if ($ss =~ /[\x{10000}-\x{10FFFF}]/) { |
403 |
|
|
while ($ss =~ /[\x{10000}-\x{10FFFF}]+/g) { |
404 |
|
|
$r += $+[0] - $-[0]; |
405 |
|
|
} |
406 |
|
|
} |
407 |
|
|
|
408 |
|
|
|
409 |
|
|
} |
410 |
|
|
$r} |
411 |
|
|
sub find_offset32 ($$) { |
412 |
|
|
my ($self, $offset16) = @_; |
413 |
|
|
my $r = 0; |
414 |
|
|
|
415 |
|
|
{ |
416 |
|
|
|
417 |
|
|
my |
418 |
wakaba |
1.10 |
$v = $$self->{ |
419 |
|
|
'con' |
420 |
|
|
}; |
421 |
wakaba |
1.1 |
|
422 |
|
|
if (not defined $offset16 or $offset16 < 0) { |
423 |
|
|
|
424 |
|
|
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#index' => $offset16, '-type' => 'INDEX_SIZE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'find_offset32', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#StringIndexOutOfBoundsException', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'offset16'; |
425 |
|
|
|
426 |
|
|
; |
427 |
|
|
} |
428 |
|
|
|
429 |
|
|
my $o = $offset16; |
430 |
|
|
while ($o > 0) { |
431 |
|
|
my $c = substr ($$v, $r, 1); |
432 |
|
|
if (length $c) { |
433 |
|
|
if ($c =~ /[\x{10000}-\x{10FFFF}]/) { |
434 |
|
|
$o -= 2; |
435 |
|
|
} else { |
436 |
|
|
$o--; |
437 |
|
|
} |
438 |
|
|
$r++; |
439 |
|
|
} else { |
440 |
|
|
|
441 |
|
|
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#index' => $offset16, '-type' => 'INDEX_SIZE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'find_offset32', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#StringIndexOutOfBoundsException', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'offset16'; |
442 |
|
|
|
443 |
|
|
; |
444 |
|
|
} |
445 |
|
|
} |
446 |
|
|
|
447 |
|
|
|
448 |
|
|
} |
449 |
|
|
$r} |
450 |
|
|
sub data ($;$) { |
451 |
|
|
if (@_ == 1) {my ($self) = @_; |
452 |
wakaba |
1.9 |
my $r = ''; |
453 |
wakaba |
1.1 |
|
454 |
|
|
{ |
455 |
|
|
|
456 |
|
|
|
457 |
wakaba |
1.10 |
$r = ${$$self->{ |
458 |
|
|
'con' |
459 |
|
|
}}; |
460 |
wakaba |
1.1 |
|
461 |
|
|
|
462 |
|
|
} |
463 |
|
|
$r; |
464 |
|
|
} else {my ($self, $given) = @_; |
465 |
|
|
|
466 |
|
|
{ |
467 |
|
|
|
468 |
|
|
|
469 |
|
|
{ |
470 |
|
|
|
471 |
|
|
if |
472 |
|
|
($self-> |
473 |
|
|
manakai_read_only |
474 |
|
|
) { |
475 |
|
|
|
476 |
wakaba |
1.12 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError'; |
477 |
wakaba |
1.1 |
|
478 |
|
|
; |
479 |
|
|
} |
480 |
|
|
|
481 |
|
|
|
482 |
|
|
} |
483 |
|
|
|
484 |
|
|
; |
485 |
wakaba |
1.10 |
my $v = $$self->{ |
486 |
|
|
'con' |
487 |
|
|
}; |
488 |
wakaba |
1.1 |
$$v = defined $given ? $given : ''; |
489 |
|
|
## NOTE: Setting NULL is supported for |
490 |
|
|
## compatibility with |textContent|. |
491 |
|
|
|
492 |
|
|
|
493 |
|
|
} |
494 |
|
|
} |
495 |
|
|
} |
496 |
|
|
sub length ($;$) { |
497 |
|
|
if (@_ == 1) {my ($self) = @_; |
498 |
|
|
my $r = 0; |
499 |
|
|
|
500 |
|
|
{ |
501 |
|
|
|
502 |
|
|
my |
503 |
wakaba |
1.10 |
$v = $$self->{ |
504 |
|
|
'con' |
505 |
|
|
}; |
506 |
wakaba |
1.2 |
$r = CORE::length $$v; |
507 |
|
|
$r++ while $$v =~ /[\x{10000}-\x{10FFFF}]/g; |
508 |
wakaba |
1.1 |
|
509 |
|
|
|
510 |
|
|
} |
511 |
|
|
$r; |
512 |
|
|
} else {my ($self) = @_; |
513 |
|
|
report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'length'; |
514 |
|
|
} |
515 |
|
|
} |
516 |
|
|
sub substring_data ($$$) { |
517 |
|
|
my ($self, $offset, $count) = @_; |
518 |
wakaba |
1.9 |
my $r = ''; |
519 |
wakaba |
1.2 |
|
520 |
|
|
{ |
521 |
|
|
|
522 |
|
|
|
523 |
|
|
{ |
524 |
|
|
|
525 |
|
|
if |
526 |
|
|
($self-> |
527 |
|
|
manakai_read_only |
528 |
|
|
) { |
529 |
|
|
|
530 |
wakaba |
1.12 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError'; |
531 |
wakaba |
1.2 |
|
532 |
|
|
; |
533 |
|
|
} |
534 |
|
|
|
535 |
|
|
|
536 |
|
|
} |
537 |
|
|
|
538 |
|
|
; |
539 |
|
|
if ($count < 0) { |
540 |
|
|
|
541 |
|
|
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INDEX_SIZE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'substring_data', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#length' => $count, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NEGATIVE_LENGTH_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'count'; |
542 |
|
|
|
543 |
|
|
; |
544 |
|
|
} |
545 |
|
|
my $eoffset32; |
546 |
|
|
|
547 |
|
|
|
548 |
|
|
try {local $Error::Depth = $Error::Depth + 3; |
549 |
|
|
|
550 |
|
|
|
551 |
|
|
$eoffset32 = $self-> |
552 |
|
|
find_offset32 |
553 |
|
|
|
554 |
|
|
($offset + $count); |
555 |
|
|
} catch |
556 |
wakaba |
1.12 |
Message::DOM::IF::DOMException with |
557 |
wakaba |
1.2 |
{ |
558 |
|
|
my $err = shift; |
559 |
|
|
if ($err->subtype eq |
560 |
|
|
'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#StringIndexOutOfBoundsException' |
561 |
|
|
) { |
562 |
|
|
$eoffset32 = ($offset + $count) * 2; |
563 |
|
|
} else { |
564 |
|
|
$err->throw; |
565 |
|
|
} |
566 |
|
|
}; |
567 |
|
|
|
568 |
|
|
|
569 |
|
|
{ |
570 |
|
|
|
571 |
|
|
local $Error::Depth = $Error::Depth + 1; |
572 |
|
|
|
573 |
|
|
{ |
574 |
|
|
|
575 |
|
|
|
576 |
|
|
my |
577 |
|
|
$offset32 = $self-> |
578 |
|
|
find_offset32 |
579 |
|
|
($offset); |
580 |
|
|
my $data = $self-> |
581 |
|
|
data |
582 |
|
|
; |
583 |
|
|
$r = substr ($data, $offset32, $eoffset32 - $offset32); |
584 |
|
|
|
585 |
|
|
|
586 |
|
|
|
587 |
|
|
} |
588 |
|
|
|
589 |
|
|
|
590 |
|
|
;} |
591 |
|
|
|
592 |
|
|
; |
593 |
|
|
|
594 |
|
|
|
595 |
|
|
} |
596 |
wakaba |
1.1 |
$r} |
597 |
|
|
sub append_data ($$) { |
598 |
|
|
my ($self, $arg) = @_; |
599 |
|
|
|
600 |
|
|
{ |
601 |
|
|
|
602 |
|
|
|
603 |
|
|
{ |
604 |
|
|
|
605 |
|
|
local $Error::Depth = $Error::Depth + 1; |
606 |
|
|
|
607 |
|
|
{ |
608 |
|
|
|
609 |
|
|
|
610 |
|
|
|
611 |
|
|
$self-> |
612 |
|
|
manakai_append_text |
613 |
|
|
(\$arg); |
614 |
|
|
|
615 |
|
|
|
616 |
|
|
|
617 |
|
|
} |
618 |
|
|
|
619 |
|
|
|
620 |
|
|
;} |
621 |
|
|
|
622 |
|
|
; |
623 |
|
|
|
624 |
|
|
|
625 |
|
|
} |
626 |
|
|
} |
627 |
|
|
sub insert_data ($$$) { |
628 |
|
|
my ($self, $offset, $arg) = @_; |
629 |
wakaba |
1.2 |
|
630 |
|
|
{ |
631 |
|
|
|
632 |
|
|
|
633 |
|
|
{ |
634 |
|
|
|
635 |
|
|
if |
636 |
|
|
($self-> |
637 |
|
|
manakai_read_only |
638 |
|
|
) { |
639 |
|
|
|
640 |
wakaba |
1.12 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError'; |
641 |
wakaba |
1.2 |
|
642 |
|
|
; |
643 |
|
|
} |
644 |
|
|
|
645 |
|
|
|
646 |
|
|
} |
647 |
|
|
|
648 |
|
|
; |
649 |
|
|
|
650 |
|
|
|
651 |
|
|
{ |
652 |
|
|
|
653 |
|
|
local $Error::Depth = $Error::Depth + 1; |
654 |
|
|
|
655 |
|
|
{ |
656 |
|
|
|
657 |
|
|
|
658 |
|
|
my |
659 |
|
|
$offset32 = $self-> |
660 |
|
|
find_offset32 |
661 |
|
|
($offset); |
662 |
|
|
my $data = $self-> |
663 |
|
|
data |
664 |
|
|
; |
665 |
|
|
substr ($data, $offset32, 0) = $arg; |
666 |
|
|
$self-> |
667 |
|
|
data |
668 |
|
|
($data); |
669 |
|
|
|
670 |
|
|
|
671 |
|
|
|
672 |
|
|
} |
673 |
|
|
|
674 |
|
|
|
675 |
|
|
;} |
676 |
|
|
|
677 |
|
|
; |
678 |
|
|
|
679 |
|
|
|
680 |
|
|
} |
681 |
wakaba |
1.1 |
} |
682 |
|
|
sub delete_data ($$$) { |
683 |
|
|
my ($self, $offset, $count) = @_; |
684 |
wakaba |
1.2 |
|
685 |
|
|
{ |
686 |
|
|
|
687 |
|
|
|
688 |
|
|
{ |
689 |
|
|
|
690 |
|
|
if |
691 |
|
|
($self-> |
692 |
|
|
manakai_read_only |
693 |
|
|
) { |
694 |
|
|
|
695 |
wakaba |
1.12 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError'; |
696 |
wakaba |
1.2 |
|
697 |
|
|
; |
698 |
|
|
} |
699 |
|
|
|
700 |
|
|
|
701 |
|
|
} |
702 |
|
|
|
703 |
|
|
; |
704 |
|
|
if ($count < 0) { |
705 |
|
|
|
706 |
|
|
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'INDEX_SIZE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'delete_data', 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#length' => $count, 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#NEGATIVE_LENGTH_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMCharacterData', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#param-name' => 'count'; |
707 |
|
|
|
708 |
|
|
; |
709 |
|
|
} |
710 |
|
|
my $eoffset32; |
711 |
|
|
|
712 |
|
|
|
713 |
|
|
try {local $Error::Depth = $Error::Depth + 3; |
714 |
|
|
|
715 |
|
|
|
716 |
|
|
$eoffset32 = $self-> |
717 |
|
|
find_offset32 |
718 |
|
|
|
719 |
|
|
($offset + $count); |
720 |
|
|
} catch |
721 |
wakaba |
1.12 |
Message::DOM::IF::DOMException with |
722 |
wakaba |
1.2 |
{ |
723 |
|
|
my $err = shift; |
724 |
|
|
if ($err->subtype eq |
725 |
|
|
'http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#StringIndexOutOfBoundsException' |
726 |
|
|
) { |
727 |
|
|
$eoffset32 = ($offset + $count) * 2; |
728 |
|
|
} else { |
729 |
|
|
$err->throw; |
730 |
|
|
} |
731 |
|
|
}; |
732 |
|
|
|
733 |
|
|
|
734 |
|
|
{ |
735 |
|
|
|
736 |
|
|
local $Error::Depth = $Error::Depth + 1; |
737 |
|
|
|
738 |
|
|
{ |
739 |
|
|
|
740 |
|
|
|
741 |
|
|
my |
742 |
|
|
$offset32 = $self-> |
743 |
|
|
find_offset32 |
744 |
|
|
($offset); |
745 |
|
|
my $data = $self-> |
746 |
|
|
data |
747 |
|
|
; |
748 |
|
|
substr ($data, $offset32, $eoffset32 - $offset32) = ''; |
749 |
|
|
$self-> |
750 |
|
|
data |
751 |
|
|
($data); |
752 |
|
|
|
753 |
|
|
|
754 |
|
|
|
755 |
|
|
} |
756 |
|
|
|
757 |
|
|
|
758 |
|
|
;} |
759 |
|
|
|
760 |
|
|
; |
761 |
|
|
|
762 |
|
|
|
763 |
|
|
} |
764 |
wakaba |
1.1 |
} |
765 |
|
|
sub replace_data ($$$$) { |
766 |
|
|
my ($self, $offset, $count, $arg) = @_; |
767 |
|
|
|
768 |
wakaba |
1.2 |
{ |
769 |
|
|
|
770 |
|
|
|
771 |
|
|
{ |
772 |
|
|
|
773 |
|
|
local $Error::Depth = $Error::Depth + 1; |
774 |
|
|
|
775 |
|
|
{ |
776 |
|
|
|
777 |
|
|
|
778 |
|
|
|
779 |
|
|
$self-> |
780 |
|
|
delete_data |
781 |
|
|
($offset, $count); |
782 |
|
|
$self-> |
783 |
|
|
insert_data |
784 |
|
|
($offset, $arg); |
785 |
|
|
|
786 |
|
|
|
787 |
wakaba |
1.1 |
|
788 |
|
|
} |
789 |
wakaba |
1.2 |
|
790 |
|
|
|
791 |
|
|
;} |
792 |
|
|
|
793 |
|
|
; |
794 |
|
|
|
795 |
|
|
|
796 |
|
|
} |
797 |
|
|
} |
798 |
wakaba |
1.1 |
$Message::DOM::DOMFeature::ClassInfo->{q<Message::DOM::CharacterData::ManakaiDOMCharacterData>}->{has_feature} = {'core', |
799 |
|
|
{'', |
800 |
|
|
'1'}, |
801 |
|
|
'xml', |
802 |
|
|
{'', |
803 |
|
|
'1'}, |
804 |
|
|
'xmlversion', |
805 |
|
|
{'', |
806 |
|
|
'1'}}; |
807 |
wakaba |
1.13 |
$Message::DOM::ClassPoint{q<Message::DOM::CharacterData::ManakaiDOMCharacterData>} = 0; |
808 |
wakaba |
1.12 |
package Message::DOM::IF::Text; |
809 |
wakaba |
1.13 |
our $VERSION = 20061230.1436; |
810 |
wakaba |
1.1 |
package Message::DOM::CharacterData::ManakaiDOMText; |
811 |
wakaba |
1.13 |
our $VERSION = 20061230.1436; |
812 |
wakaba |
1.1 |
push our @ISA, 'Message::DOM::CharacterData::ManakaiDOMCharacterData', |
813 |
wakaba |
1.12 |
'Message::DOM::IF::CharacterData', |
814 |
|
|
'Message::DOM::IF::Node', |
815 |
|
|
'Message::DOM::IF::Text'; |
816 |
wakaba |
1.1 |
sub node_type ($;$) { |
817 |
|
|
if (@_ == 1) {my ($self) = @_; |
818 |
|
|
my $r; |
819 |
wakaba |
1.5 |
$r = 3; |
820 |
wakaba |
1.1 |
$r; |
821 |
|
|
} else {my ($self) = @_; |
822 |
|
|
report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMText', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_type'; |
823 |
|
|
} |
824 |
|
|
} |
825 |
|
|
sub node_name ($;$) { |
826 |
|
|
if (@_ == 1) {my ($self) = @_; |
827 |
|
|
my $r = '#text'; |
828 |
|
|
$r; |
829 |
|
|
} else {my ($self) = @_; |
830 |
|
|
report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMText', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_name'; |
831 |
|
|
} |
832 |
|
|
} |
833 |
|
|
sub get_feature ($$$) { |
834 |
|
|
my ($self, $feature, $version) = @_; |
835 |
|
|
|
836 |
|
|
{ |
837 |
|
|
|
838 |
|
|
|
839 |
|
|
$feature = lc $feature; |
840 |
|
|
|
841 |
|
|
|
842 |
|
|
} |
843 |
|
|
|
844 |
|
|
{ |
845 |
|
|
|
846 |
|
|
|
847 |
|
|
$version = '' unless defined $version; |
848 |
|
|
|
849 |
|
|
|
850 |
|
|
} |
851 |
|
|
my $r; |
852 |
|
|
|
853 |
|
|
{ |
854 |
|
|
|
855 |
|
|
|
856 |
|
|
$feature =~ s/^\+//; |
857 |
|
|
|
858 |
|
|
|
859 |
|
|
{ |
860 |
|
|
|
861 |
|
|
if |
862 |
wakaba |
1.7 |
($Message::Util::AutoLoad::Registry::Feature->{$feature}->{$version}) { |
863 |
wakaba |
1.1 |
$r = $self; |
864 |
|
|
} |
865 |
|
|
|
866 |
|
|
|
867 |
|
|
} |
868 |
|
|
|
869 |
|
|
; |
870 |
|
|
unless (defined $r) { |
871 |
|
|
|
872 |
|
|
|
873 |
|
|
{ |
874 |
|
|
|
875 |
|
|
local $Error::Depth = $Error::Depth + 1; |
876 |
|
|
|
877 |
|
|
{ |
878 |
|
|
|
879 |
|
|
|
880 |
|
|
|
881 |
|
|
$r = $self->SUPER::get_feature ($feature, $version); |
882 |
|
|
|
883 |
|
|
|
884 |
|
|
|
885 |
|
|
} |
886 |
|
|
|
887 |
|
|
|
888 |
|
|
;} |
889 |
|
|
|
890 |
|
|
; |
891 |
|
|
} |
892 |
|
|
|
893 |
|
|
|
894 |
|
|
} |
895 |
|
|
$r} |
896 |
|
|
sub is_element_content_whitespace ($;$) { |
897 |
|
|
if (@_ == 1) {my ($self) = @_; |
898 |
|
|
my $r = 0; |
899 |
|
|
|
900 |
|
|
{ |
901 |
|
|
|
902 |
|
|
|
903 |
wakaba |
1.10 |
$r = $$self->{ |
904 |
|
|
'ecws' |
905 |
|
|
}; |
906 |
wakaba |
1.1 |
|
907 |
|
|
|
908 |
|
|
} |
909 |
|
|
$r; |
910 |
|
|
} else {my ($self, $given) = @_; |
911 |
|
|
|
912 |
|
|
{ |
913 |
|
|
|
914 |
|
|
|
915 |
|
|
{ |
916 |
|
|
|
917 |
|
|
if |
918 |
|
|
($self-> |
919 |
|
|
manakai_read_only |
920 |
|
|
) { |
921 |
|
|
|
922 |
wakaba |
1.12 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError'; |
923 |
wakaba |
1.1 |
|
924 |
|
|
; |
925 |
|
|
} |
926 |
|
|
|
927 |
|
|
|
928 |
|
|
} |
929 |
|
|
|
930 |
|
|
; |
931 |
wakaba |
1.10 |
$$self->{ |
932 |
|
|
'ecws' |
933 |
|
|
} = $given; |
934 |
wakaba |
1.1 |
|
935 |
|
|
|
936 |
|
|
} |
937 |
|
|
} |
938 |
|
|
} |
939 |
|
|
sub whole_text ($;$) { |
940 |
|
|
if (@_ == 1) {my ($self) = @_; |
941 |
wakaba |
1.9 |
my $r = ''; |
942 |
wakaba |
1.3 |
|
943 |
|
|
{ |
944 |
|
|
|
945 |
|
|
|
946 |
|
|
{ |
947 |
|
|
|
948 |
|
|
local $Error::Depth = $Error::Depth + 1; |
949 |
|
|
|
950 |
|
|
{ |
951 |
|
|
|
952 |
|
|
|
953 |
|
|
require |
954 |
|
|
Message::DOM::Traversal; |
955 |
|
|
my $doc = $self-> |
956 |
|
|
owner_document |
957 |
|
|
; |
958 |
|
|
my $doctrv = $doc-> |
959 |
|
|
get_feature |
960 |
|
|
(Traversal => '2.0'); |
961 |
|
|
my $tw1 = $doctrv-> |
962 |
|
|
create_tree_walker |
963 |
|
|
|
964 |
|
|
($doc, |
965 |
wakaba |
1.5 |
4294967295 |
966 |
wakaba |
1.3 |
, sub { |
967 |
|
|
($_[1]-> |
968 |
|
|
node_type |
969 |
|
|
|
970 |
|
|
== |
971 |
wakaba |
1.5 |
5 |
972 |
wakaba |
1.3 |
) |
973 |
|
|
? |
974 |
wakaba |
1.5 |
3 |
975 |
wakaba |
1.3 |
: |
976 |
|
|
|
977 |
wakaba |
1.5 |
1 |
978 |
wakaba |
1.3 |
|
979 |
|
|
}, |
980 |
|
|
1 |
981 |
|
|
); |
982 |
|
|
$tw1-> |
983 |
|
|
current_node |
984 |
|
|
($self); |
985 |
|
|
my $tw2 = $tw1->clone; |
986 |
|
|
$r = $self-> |
987 |
|
|
node_value |
988 |
|
|
; |
989 |
|
|
|
990 |
|
|
S: while (defined (my $node = $tw1-> |
991 |
|
|
previous_sibling |
992 |
|
|
)) { |
993 |
|
|
my $nt = $node-> |
994 |
|
|
node_type |
995 |
|
|
; |
996 |
|
|
if ($nt == |
997 |
wakaba |
1.5 |
3 or |
998 |
wakaba |
1.3 |
|
999 |
|
|
$nt == |
1000 |
wakaba |
1.5 |
4 |
1001 |
wakaba |
1.3 |
) { |
1002 |
|
|
$r = $node-> |
1003 |
|
|
node_value |
1004 |
|
|
. $r; |
1005 |
|
|
} else { |
1006 |
|
|
last S; |
1007 |
|
|
} |
1008 |
|
|
} # S |
1009 |
|
|
|
1010 |
|
|
S: while (defined (my $node = $tw2-> |
1011 |
|
|
next_sibling |
1012 |
|
|
)) { |
1013 |
|
|
my $nt = $node-> |
1014 |
|
|
node_type |
1015 |
|
|
; |
1016 |
|
|
if ($nt == |
1017 |
wakaba |
1.5 |
3 or |
1018 |
wakaba |
1.3 |
|
1019 |
|
|
$nt == |
1020 |
wakaba |
1.5 |
4 |
1021 |
wakaba |
1.3 |
) { |
1022 |
|
|
$r .= $node-> |
1023 |
|
|
node_value |
1024 |
|
|
; |
1025 |
|
|
} else { |
1026 |
|
|
last S; |
1027 |
|
|
} |
1028 |
|
|
} # S |
1029 |
|
|
|
1030 |
|
|
|
1031 |
|
|
|
1032 |
|
|
} |
1033 |
|
|
|
1034 |
|
|
|
1035 |
|
|
;} |
1036 |
|
|
|
1037 |
|
|
; |
1038 |
|
|
|
1039 |
|
|
|
1040 |
|
|
} |
1041 |
|
|
$r; |
1042 |
wakaba |
1.1 |
} else {my ($self) = @_; |
1043 |
|
|
report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMText', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'whole_text'; |
1044 |
|
|
} |
1045 |
|
|
} |
1046 |
|
|
sub replace_whole_text ($$) { |
1047 |
|
|
my ($self, $content) = @_; |
1048 |
|
|
my $r; |
1049 |
|
|
report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NOT_SUPPORTED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'replace_whole_text', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#MDOM_IMPL_METHOD_NOT_IMPLEMENTED', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMText'; |
1050 |
|
|
$r} |
1051 |
|
|
sub split_text ($$) { |
1052 |
|
|
my ($self, $offset) = @_; |
1053 |
|
|
my $r; |
1054 |
wakaba |
1.2 |
|
1055 |
|
|
{ |
1056 |
|
|
|
1057 |
|
|
|
1058 |
|
|
{ |
1059 |
|
|
|
1060 |
|
|
if |
1061 |
|
|
($self-> |
1062 |
|
|
manakai_read_only |
1063 |
|
|
) { |
1064 |
|
|
|
1065 |
wakaba |
1.12 |
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_THIS', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#resourceURI' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/NodeReadOnlyError'; |
1066 |
wakaba |
1.2 |
|
1067 |
|
|
; |
1068 |
|
|
} |
1069 |
|
|
|
1070 |
|
|
|
1071 |
|
|
} |
1072 |
|
|
|
1073 |
|
|
; |
1074 |
|
|
my $parent = $self-> |
1075 |
|
|
parent_node |
1076 |
|
|
; |
1077 |
|
|
if (defined $parent and $parent-> |
1078 |
|
|
manakai_read_only |
1079 |
|
|
) { |
1080 |
|
|
|
1081 |
|
|
report Message::DOM::DOMCore::ManakaiDOMException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#method' => 'split_text', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#NOMOD_PARENT', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMText'; |
1082 |
|
|
|
1083 |
|
|
; |
1084 |
|
|
} |
1085 |
|
|
|
1086 |
|
|
|
1087 |
|
|
|
1088 |
|
|
{ |
1089 |
|
|
|
1090 |
|
|
local $Error::Depth = $Error::Depth + 1; |
1091 |
|
|
|
1092 |
|
|
{ |
1093 |
|
|
|
1094 |
|
|
|
1095 |
|
|
my |
1096 |
|
|
$offset32 = $self-> |
1097 |
|
|
find_offset32 |
1098 |
|
|
($offset); |
1099 |
|
|
my $data1 = $self-> |
1100 |
|
|
data |
1101 |
|
|
; |
1102 |
|
|
my $data2 = substr ($data1, $offset32); |
1103 |
|
|
substr ($data1, $offset32) = ''; |
1104 |
|
|
|
1105 |
|
|
$r = $self-> |
1106 |
|
|
node_type |
1107 |
|
|
== |
1108 |
wakaba |
1.5 |
3 |
1109 |
wakaba |
1.2 |
|
1110 |
|
|
? $self-> |
1111 |
|
|
owner_document |
1112 |
|
|
|
1113 |
|
|
-> |
1114 |
|
|
create_text_node |
1115 |
|
|
($data2) |
1116 |
|
|
: $self-> |
1117 |
|
|
owner_document |
1118 |
|
|
|
1119 |
|
|
-> |
1120 |
|
|
create_cdata_section |
1121 |
|
|
($data2); |
1122 |
|
|
$r-> |
1123 |
|
|
is_element_content_whitespace |
1124 |
|
|
|
1125 |
|
|
($self-> |
1126 |
|
|
is_element_content_whitespace |
1127 |
|
|
); |
1128 |
|
|
$self-> |
1129 |
|
|
data |
1130 |
|
|
($data1); |
1131 |
|
|
if (defined $parent) { |
1132 |
|
|
$parent-> |
1133 |
|
|
insert_before |
1134 |
|
|
|
1135 |
|
|
($r, $self-> |
1136 |
|
|
next_sibling |
1137 |
|
|
); |
1138 |
|
|
} |
1139 |
|
|
|
1140 |
|
|
|
1141 |
|
|
|
1142 |
|
|
} |
1143 |
|
|
|
1144 |
|
|
|
1145 |
|
|
;} |
1146 |
|
|
|
1147 |
|
|
; |
1148 |
|
|
|
1149 |
|
|
|
1150 |
|
|
} |
1151 |
wakaba |
1.1 |
$r} |
1152 |
|
|
$Message::DOM::DOMFeature::ClassInfo->{q<Message::DOM::CharacterData::ManakaiDOMText>}->{has_feature} = {'core', |
1153 |
|
|
{'', |
1154 |
|
|
'1'}, |
1155 |
|
|
'xml', |
1156 |
|
|
{'', |
1157 |
|
|
'1'}, |
1158 |
|
|
'xmlversion', |
1159 |
|
|
{'', |
1160 |
|
|
'1'}}; |
1161 |
wakaba |
1.13 |
$Message::DOM::ClassPoint{q<Message::DOM::CharacterData::ManakaiDOMText>} = 0; |
1162 |
wakaba |
1.12 |
package Message::DOM::IF::Comment; |
1163 |
wakaba |
1.13 |
our $VERSION = 20061230.1436; |
1164 |
wakaba |
1.1 |
package Message::DOM::CharacterData::ManakaiDOMComment; |
1165 |
wakaba |
1.13 |
our $VERSION = 20061230.1436; |
1166 |
wakaba |
1.1 |
push our @ISA, 'Message::DOM::CharacterData::ManakaiDOMCharacterData', |
1167 |
wakaba |
1.12 |
'Message::DOM::IF::CharacterData', |
1168 |
|
|
'Message::DOM::IF::Comment', |
1169 |
|
|
'Message::DOM::IF::Node'; |
1170 |
wakaba |
1.1 |
sub node_type ($;$) { |
1171 |
|
|
if (@_ == 1) {my ($self) = @_; |
1172 |
|
|
my $r; |
1173 |
wakaba |
1.5 |
$r = 8; |
1174 |
wakaba |
1.1 |
$r; |
1175 |
|
|
} else {my ($self) = @_; |
1176 |
|
|
report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMComment', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_type'; |
1177 |
|
|
} |
1178 |
|
|
} |
1179 |
|
|
sub node_name ($;$) { |
1180 |
|
|
if (@_ == 1) {my ($self) = @_; |
1181 |
wakaba |
1.9 |
my $r = ''; |
1182 |
wakaba |
1.1 |
$r = '#comment'; |
1183 |
|
|
$r; |
1184 |
|
|
} else {my ($self) = @_; |
1185 |
|
|
report Message::Util::Error::DOMException::CoreException -object => $self, '-type' => 'NO_MODIFICATION_ALLOWED_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#on' => 'get', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#subtype' => 'http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#READ_ONLY_ATTRIBUTE_ERR', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#class' => 'Message::DOM::CharacterData::ManakaiDOMComment', 'http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#attr' => 'node_name'; |
1186 |
|
|
} |
1187 |
|
|
} |
1188 |
|
|
sub get_feature ($$$) { |
1189 |
|
|
my ($self, $feature, $version) = @_; |
1190 |
|
|
|
1191 |
|
|
{ |
1192 |
|
|
|
1193 |
|
|
|
1194 |
|
|
$feature = lc $feature; |
1195 |
|
|
|
1196 |
|
|
|
1197 |
|
|
} |
1198 |
|
|
|
1199 |
|
|
{ |
1200 |
|
|
|
1201 |
|
|
|
1202 |
|
|
$version = '' unless defined $version; |
1203 |
|
|
|
1204 |
|
|
|
1205 |
|
|
} |
1206 |
|
|
my $r; |
1207 |
|
|
|
1208 |
|
|
{ |
1209 |
|
|
|
1210 |
|
|
|
1211 |
|
|
$feature =~ s/^\+//; |
1212 |
|
|
|
1213 |
|
|
|
1214 |
|
|
{ |
1215 |
|
|
|
1216 |
|
|
if |
1217 |
wakaba |
1.7 |
($Message::Util::AutoLoad::Registry::Feature->{$feature}->{$version}) { |
1218 |
wakaba |
1.1 |
$r = $self; |
1219 |
|
|
} |
1220 |
|
|
|
1221 |
|
|
|
1222 |
|
|
} |
1223 |
|
|
|
1224 |
|
|
; |
1225 |
|
|
unless (defined $r) { |
1226 |
|
|
|
1227 |
|
|
|
1228 |
|
|
{ |
1229 |
|
|
|
1230 |
|
|
local $Error::Depth = $Error::Depth + 1; |
1231 |
|
|
|
1232 |
|
|
{ |
1233 |
|
|
|
1234 |
|
|
|
1235 |
|
|
|
1236 |
|
|
$r = $self->SUPER::get_feature ($feature, $version); |
1237 |
|
|
|
1238 |
|
|
|
1239 |
|
|
|
1240 |
|
|
} |
1241 |
|
|
|
1242 |
|
|
|
1243 |
|
|
;} |
1244 |
|
|
|
1245 |
|
|
; |
1246 |
|
|
} |
1247 |
|
|
|
1248 |
|
|
|
1249 |
|
|
} |
1250 |
|
|
$r} |
1251 |
|
|
$Message::DOM::DOMFeature::ClassInfo->{q<Message::DOM::CharacterData::ManakaiDOMComment>}->{has_feature} = {'core', |
1252 |
|
|
{'', |
1253 |
|
|
'1'}, |
1254 |
|
|
'xml', |
1255 |
|
|
{'', |
1256 |
|
|
'1'}, |
1257 |
|
|
'xmlversion', |
1258 |
|
|
{'', |
1259 |
|
|
'1'}}; |
1260 |
wakaba |
1.13 |
$Message::DOM::ClassPoint{q<Message::DOM::CharacterData::ManakaiDOMComment>} = 0; |
1261 |
wakaba |
1.12 |
package Message::DOM::IF::StringExtended; |
1262 |
wakaba |
1.13 |
our $VERSION = 20061230.1436; |
1263 |
wakaba |
1.12 |
for ($Message::DOM::IF::Node::){} |
1264 |
wakaba |
1.1 |
## License: <http://suika.fam.cx/~wakaba/archive/2004/8/18/license#Perl+MPL> |
1265 |
|
|
1; |