/[suikacvs]/test/html-webhacc/WebHACC/Language/CacheManifest.pm
Suika

Contents of /test/html-webhacc/WebHACC/Language/CacheManifest.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Mon Jul 21 08:39:12 2008 UTC (16 years, 11 months ago) by wakaba
Branch: MAIN
Changes since 1.2: +8 -7 lines
++ ChangeLog	21 Jul 2008 08:33:17 -0000
	* cc.cgi (print_table_section): Removed (now part of
	WebHACC::Language::DOM).

2008-07-21  Wakaba  <wakaba@suika.fam.cx>

++ html/WebHACC/Language/ChangeLog	21 Jul 2008 08:39:05 -0000
	* Base.pm (generate_source_string_section): Invoke
	|add_source_to_parse_error_list| method for generating a
	script fragment.

	* CSS.pm, CacheManifest.pm, DOM.pm, HTML.pm, WebIDL.pm,
	XML.pm: Use new methods for generating sections and error lists.

	* DOM.pm (generate_additional_sections, generate_table_section): New.

	* Default.pm: Pass |input| in place of |url| for unknown syntax
	error.

2008-07-21  Wakaba  <wakaba@suika.fam.cx>

++ html/WebHACC/ChangeLog	21 Jul 2008 08:36:01 -0000
	* Output.pm (start_section, end_section): "role" option
	implemented.  Automatical rank setting implemented.
	(start_error_list, end_error_list): New.
	(add_source_to_parse_error_list): New.

	* Result.pm: "Unknown location" message text changed.

2008-07-21  Wakaba  <wakaba@suika.fam.cx>

1 wakaba 1.1 package WebHACC::Language::CacheManifest;
2     use strict;
3     require WebHACC::Language::Base;
4     push our @ISA, 'WebHACC::Langauge::Base';
5    
6     sub new ($) {
7     my $self = bless {}, shift;
8     return $self;
9     } # new
10    
11     sub generate_syntax_error_section ($) {
12     my $self = shift;
13    
14     require Whatpm::CacheManifest;
15    
16     my $out = $self->output;
17    
18 wakaba 1.3 $out->start_section (role => 'parse-errors');
19     $out->start_error_list (role => 'parse-errors');
20 wakaba 1.1
21     my $input = $self->input;
22     my $result = $self->result;
23    
24     my $m = $input->{is_char_string} ? 'parse_char_string' : 'parse_byte_string';
25     $self->{structure} = Whatpm::CacheManifest->$m
26 wakaba 1.2 ($input->{s}, $input->{uri}, $input->{base_uri}, sub {
27     $result->add_error (@_, layer => 'syntax', index_has_link => 1);
28     });
29 wakaba 1.3
30     $out->end_error_list (role => 'parse-errors');
31 wakaba 1.1 $out->end_section;
32     } # generate_syntax_error_section
33    
34     sub generate_structure_dump_section ($) {
35     my $self = shift;
36     my $manifest = $self->{structure};
37    
38 wakaba 1.3 $self->start_section (role => 'structure');
39 wakaba 1.1
40     $self->html (qq[<dl><dt>Explicit entries</dt>]);
41     my $i = 0;
42     for my $uri (@{$manifest->[0]}) {
43     $out->start_tag ('dd', id => 'index-' . $i++);
44     $out->url ($uri);
45     }
46    
47     $out->html (qq[<dt>Fallback entries</dt><dd>
48     <table><thead><tr><th scope=row>Oppotunistic Caching Namespace</th>
49     <th scope=row>Fallback Entry</tr><tbody>]);
50     for my $uri (sort {$a cmp $b} keys %{$manifest->[1]}) {
51     $out->start_tag ('tr');
52    
53     $out->start_tag ('td', id => 'index-' . $i++);
54     $out->url ($uri);
55    
56     $out->start_tag ('td', id => 'index-' . $i++);
57     $out->url ($manifest->[1]->{$uri});
58     }
59    
60     $out->html (qq[</table><dt>Online whitelist</dt>]);
61     for my $uri (@{$manifest->[2]}) {
62     $out->start_tag ('dd', id => 'index-' . $i++);
63     $out->url ($uri);
64     }
65    
66     $out->end_section;
67     } # generate_structure_dump_section
68    
69     sub generate_structure_error_section ($) {
70     my $self = shift;
71    
72     my $out = $self->output;
73    
74 wakaba 1.3 $out->start_section (role => 'structure-errors');
75     $out->start_error_list (role => 'structure-errors');
76 wakaba 1.1
77     my $result = $out->result;
78    
79     Whatpm::CacheManifest->check_manifest ($self->{structure}, sub {
80 wakaba 1.2 $result->add_error (@_, layer => 'structure');
81 wakaba 1.1 });
82    
83 wakaba 1.3 $out->end_error_list;
84 wakaba 1.1 $out->end_section;
85     } # generate_structure_error_section
86    
87     sub source_charset ($) {
88     return 'utf-8';
89     } # source_charset
90    
91     1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24