--- test/html-webhacc/cc.cgi 2008/05/18 03:47:56 1.51 +++ 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,6 +681,42 @@ return $manifest; } # print_syntax_error_manifest_section +sub print_syntax_error_webidl_section ($$) { + my ($input, $result) = @_; + + require Whatpm::WebIDL; + + print STDOUT qq[ +
"; + print STDOUT htescape ($idl->idl_text); + print STDOUT ""; + + print STDOUT qq[