Parent Directory | Revision Log
++ ChangeLog 14 Aug 2008 15:42:17 -0000 * cc.cgi: Generate result summary sections for each subdocument. * error-description-source.xml: New entries to support localization of result sections. 2008-08-14 Wakaba <wakaba@suika.fam.cx> * cc-style.css: Support for revised version of result summary section styling. 2008-08-14 Wakaba <wakaba@suika.fam.cx> ++ html/WebHACC/Language/ChangeLog 14 Aug 2008 15:50:38 -0000 * Base.pm, CSS.pm, CacheManifest.pm, DOM.pm, Default.pm, HTML.pm, WebIDL.pm, XML.pm: Set |layer_applicable| or |layer_uncertain| flag appropriately. 2008-08-14 Wakaba <wakaba@suika.fam.cx> ++ html/WebHACC/ChangeLog 14 Aug 2008 15:48:38 -0000 * Input.pm: Methods |generate_transfer_sections| and |generate_http_header_section| are moved to HTTP subclass, since they are irrelevant to non-HTTP inputs. (_get_document): Forbidden host error was not represented by WebHACC::Input::Error subclass. (WebHACC::Input::Error generate_transfer_sections): Use role name for the section. (WebHACC::Input::HTTPError generate_transfer_sections): New method added, since the main superclass, i.e. WebHACC::Input::Error, no longer dumps HTTP headers due to the change mentioned above. * Output.pm (start_section): New roles "transfer-errors" and "result". * Result.pm (parent_result): New attribute. (layer_applicable, layer_uncertain): New methods to set flags. (add_error): Natural language strings are now handled by the catalog mechanism. Use new scoring mechanism. (generate_result_section): Use catalog for all natural language strings. Table generation is now much more sophiscated that it was. Support for subdoc result summary. Support for the column of the number of informational message. Support for "N/A" status. 2008-08-14 Wakaba <wakaba@suika.fam.cx>
1 | package WebHACC::Language::WebIDL; |
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::WebIDL; |
15 | |
16 | $self->result->layer_uncertain ('encode'); |
17 | $self->result->layer_uncertain ('charset'); |
18 | |
19 | my $out = $self->output; |
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 | require Encode; |
28 | my $s = $input->{is_char_string} ? $input->{s} : Encode::decode ($input->{charset} || 'utf-8', $input->{s}); ## TODO: charset |
29 | my $parser = Whatpm::WebIDL::Parser->new; |
30 | |
31 | $self->{structure} = $parser->parse_char_string ($input->{s}, sub { |
32 | $result->add_error (@_, layer => 'syntax'); |
33 | }); |
34 | |
35 | $out->end_error_list (role => 'parse-errors'); |
36 | $out->end_section; |
37 | } # generate_parse_error_section |
38 | |
39 | sub generate_structure_dump_section ($) { |
40 | my $self = shift; |
41 | |
42 | my $out = $self->output; |
43 | |
44 | $out->start_section (role => 'reformatted'); |
45 | |
46 | $out->start_code_block; |
47 | $out->text ($self->{structure}->idl_text); |
48 | $out->end_code_block; |
49 | |
50 | $out->end_section |
51 | } # generate_structure_dump_section |
52 | |
53 | sub generate_structure_error_section ($) { |
54 | my $self = shift; |
55 | |
56 | my $out = $self->output; |
57 | |
58 | $out->start_section (role => 'structure-errors'); |
59 | $out->start_error_list (role => 'structure-errors'); |
60 | $self->result->layer_applicable ('structure'); |
61 | |
62 | $self->{structure}->check (sub { |
63 | $self->result->add_error (@_, layer => 'structure'); |
64 | }); |
65 | |
66 | $out->end_error_list (role => 'structure-errors'); |
67 | $out->end_section; |
68 | } # generate_structure_error_section |
69 | |
70 | 1; |
admin@suikawiki.org | ViewVC Help |
Powered by ViewVC 1.1.24 |