/[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.6 - (show annotations) (download)
Fri Aug 15 05:53:23 2008 UTC (16 years, 10 months ago) by wakaba
Branch: MAIN
Changes since 1.5: +2 -1 lines
++ ChangeLog	15 Aug 2008 05:43:43 -0000
2008-08-15  Wakaba  <wakaba@suika.fam.cx>

	* cc-style.css: Add icons to links and headings of error sections.
	Use standard "uncertain" color for level-u errors.  "No error found"
	messages are now handled by catalog, not by CSS presentation.
	The result paragraph saying that the conformance is unknown
	should be bordered as uncertain error messages are.

	* error-description-source.xml: New message entries
	for not-translated-yet messages.  Distinguish result table's
	layer names from other similar texts.

++ html/WebHACC/Language/ChangeLog	15 Aug 2008 05:53:19 -0000
2008-08-15  Wakaba  <wakaba@suika.fam.cx>

	* CSS.pm, CacheManifest.pm, HTML.pm, WebIDL.pm, XML.pm: Don't
	set "uncertain" flag to character encoding (encode) layer if the
	input is a character string.

++ html/WebHACC/ChangeLog	15 Aug 2008 05:51:54 -0000
2008-08-15  Wakaba  <wakaba@suika.fam.cx>

	* Input.pm (generate_transfer_sections): Use standard
	error list methods for transfer errors.  Typos fixed.

	* Output.pm (has_error): New attribute.
	(start_error_list, end_error_list): Support for role "transfer-errors".
	(end_error_list): Generate "no error found" paragraph if it should be.
	(generate_input_section): Decode parameters as UTF-8.

	* Result.pm (add_error): Set |has_error| flag.  Use catalog
	for "Unknown location" message.
	(generate_result_section): Use different text for
	result table rows than normal messages, to avoid collision
	with other messages (such as "Charset").

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24