--- test/html-webhacc/cc.cgi 2008/05/06 08:47:09 1.50
+++ test/html-webhacc/cc.cgi 2008/07/18 14:44:16 1.52
@@ -161,6 +161,7 @@
my $el;
my $cssom;
my $manifest;
+ my $idl;
my @subdoc;
if ($input->{media_type} eq 'text/html') {
@@ -195,6 +196,10 @@
$manifest = print_syntax_error_manifest_section ($input, $result);
print_source_string_section ($input, \($input->{s}),
'utf-8');
+ } elsif ($input->{media_type} eq 'text/x-webidl') { ## TODO: type
+ $idl = print_syntax_error_webidl_section ($input, $result);
+ print_source_string_section ($input, \($input->{s}),
+ 'utf-8'); ## TODO: charset
} else {
## TODO: Change HTTP status code??
print_result_unknown_type_section ($input, $result);
@@ -227,6 +232,9 @@
} elsif (defined $manifest) {
print_structure_dump_manifest_section ($input, $manifest);
print_structure_error_manifest_section ($input, $manifest, $result);
+ } elsif (defined $idl) {
+ print_structure_dump_webidl_section ($input, $idl);
+ print_structure_error_webidl_section ($input, $idl, $result);
}
my $id_prefix = 0;
@@ -673,15 +681,68 @@
return $manifest;
} # print_syntax_error_manifest_section
+sub print_syntax_error_webidl_section ($$) {
+ my ($input, $result) = @_;
+
+ require Whatpm::WebIDL;
+
+ print STDOUT qq[
+
];
+
+ return $idl;
+} # print_syntax_error_webidl_section
+
sub print_source_string_section ($$$) {
my $input = shift;
my $s;
unless ($input->{is_char_string}) {
- require Encode;
- my $enc = Encode::find_encoding ($_[1]); ## TODO: charset name -> Perl name
- return unless $enc;
+ open my $byte_stream, '<', $_[0];
+ require Message::Charset::Info;
+ my $charset = Message::Charset::Info->get_by_iana_name ($_[1]);
+ my ($char_stream, $e_status) = $charset->get_decode_handle
+ ($byte_stream, allow_error_reporting => 1, allow_fallback => 1);
+ return unless $char_stream;
+
+ $char_stream->onerror (sub {
+ my (undef, $type, %opt) = @_;
+ if ($opt{octets}) {
+ ${$opt{octets}} = "\x{FFFD}";
+ }
+ });
- $s = \($enc->decode (${$_[0]}));
+ my $t = '';
+ while (1) {
+ my $c = $char_stream->getc;
+ last unless defined $c;
+ $t .= $c;
+ }
+ $s = \$t;
+ ## TODO: Output for each line, don't concat all of lines.
} else {
$s = $_[0];
}
@@ -870,6 +931,23 @@
print STDOUT qq[];
} # print_structure_dump_manifest_section
+sub print_structure_dump_webidl_section ($$) {
+ my ($input, $idl) = @_;
+
+ print STDOUT qq[
+];
+} # print_structure_dump_webidl_section
+
sub print_structure_error_dom_section ($$$$$) {
my ($input, $doc, $el, $result, $onsubdoc) = @_;
@@ -937,6 +1015,21 @@
print STDOUT qq[];
} # print_structure_error_manifest_section
+sub print_structure_error_webidl_section ($$$) {
+ my ($input, $idl, $result) = @_;
+
+ print STDOUT qq[];
+} # print_structure_error_webidl_section
+
sub print_table_section ($$) {
my ($input, $tables) = @_;
@@ -1182,24 +1275,25 @@
print STDOUT qq[$label | $result->{$_->[1]}->{must}$uncertain | $result->{$_->[1]}->{should}$uncertain | $result->{$_->[1]}->{warning}$uncertain | ];
if ($uncertain) {
- print qq[−∞..$result->{$_->[1]}->{score_max} | ];
+ print qq[−∞..$result->{$_->[1]}->{score_max}];
} elsif ($result->{$_->[1]}->{score_min} != $result->{$_->[1]}->{score_max}) {
- print qq[ | $result->{$_->[1]}->{score_min}..$result->{$_->[1]}->{score_max} |
];
+ print qq[$result->{$_->[1]}->{score_min}..$result->{$_->[1]}->{score_max}];
} else {
- print qq[ | $result->{$_->[1]}->{score_min} | ];
+ print qq[$result->{$_->[1]}->{score_min}];
}
+ print qq[ / 20];
}
$score_max += $score_base;
print STDOUT qq[
- | Semantics | 0? | 0? | 0? | −∞..$score_base |
+Semantics | 0? | 0? | 0? | −∞..$score_base / 20
|
---|
Total |
$must_error? |
$should_error? |
$warning? |
-−∞..$score_max |
+−∞..$score_max / 100
Important: This conformance checking service
@@ -1623,4 +1717,4 @@
=cut
-## $Date: 2008/05/06 08:47:09 $
+## $Date: 2008/07/18 14:44:16 $
|