summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorot <ot@localhost>2007-05-07 16:14:15 +0000
committerot <ot@localhost>2007-05-07 16:14:15 +0000
commit4ab94cc0d49ed648f06171e513ca99400cfbd88d (patch)
tree5379839d34b43c96d253ed9f171ae48d8610b096
parent4f26fd3a2f5104e854ddb535459341a4363cced0 (diff)
downloadmarkup-validator-4ab94cc0d49ed648f06171e513ca99400cfbd88d.zip
markup-validator-4ab94cc0d49ed648f06171e513ca99400cfbd88d.tar.gz
markup-validator-4ab94cc0d49ed648f06171e513ca99400cfbd88d.tar.bz2
better display of information in case of fatal error (show preparse warning,
e.g http://www.w3.org/Bugs/Public/show_bug.cgi?id=2572 ) and revalidation table.
-rw-r--r--htdocs/style/results.css6
-rwxr-xr-xhttpd/cgi-bin/check10
-rw-r--r--share/templates/en_US/fatal-error.tmpl34
3 files changed, 32 insertions, 18 deletions
diff --git a/htdocs/style/results.css b/htdocs/style/results.css
index 9aa2424..bd8ab1b 100644
--- a/htdocs/style/results.css
+++ b/htdocs/style/results.css
@@ -1,5 +1,5 @@
/* style sheet for the validator's results page */
-/* $Id: results.css,v 1.15 2007-04-18 08:20:49 ot Exp $ */
+/* $Id: results.css,v 1.16 2007-05-07 16:14:15 ot Exp $ */
.input {
color: black;
@@ -54,7 +54,7 @@ fieldset#revalidate_opts table.header, fieldset#revalidate_opts table.header td,
/* "Fatal" warnings... */
-ol#warnings, ol#error_loop {
+ol#warnings, ol#error_loop, ol#fatal-errors {
margin-left: 0 !important;
margin-right: 0 !important;
}
@@ -73,7 +73,7 @@ ol li.msg_info:hover, ol li.msg_warn:hover, ol li.msg_err:hover {
}
-ol#warnings, ol#error_loop {
+ol#warnings, ol#error_loop, ol#fatal-errors {
padding:0;
border-top: 1px solid #eee;
}
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index d244112..67abc59 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -14,7 +14,7 @@
# This source code is available under the license at:
# http://www.w3.org/Consortium/Legal/copyright-software
#
-# $Id: check,v 1.516 2007-05-07 14:42:31 ot Exp $
+# $Id: check,v 1.517 2007-05-07 16:14:15 ot Exp $
#
# Disable buffering on STDOUT!
@@ -180,7 +180,7 @@ Directory not readable (permission denied): @_r
#
# Strings
- $VERSION = q$Revision: 1.516 $;
+ $VERSION = q$Revision: 1.517 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
#
@@ -490,10 +490,8 @@ unless ($File->{Charset}->{Use}) {
#
# Handle any Fallback or Override for the charset.
-if (charset_not_equal($File->{Opt}->{Charset}, '(detect automatically)')
- and charset_not_equal($File->{Opt}->{Charset}, '')) {
+if (charset_not_equal($File->{Opt}->{Charset}, '(detect automatically)')) {
# charset=foo was given to the CGI and it wasn't "autodetect" or empty.
-
#
# Extract the user-requested charset from CGI param.
my ($override, undef) = split(/\s/, $File->{Opt}->{Charset}, 2);
@@ -2108,6 +2106,8 @@ sub abort_if_error_flagged {
return unless $File->{'Error Flagged'};
return if $File->{'Error Handled'}; # Previous error, keep going.
+ $File->{Templates}->{Error}->param(fatal_error => TRUE);
+
if ($File->{Opt}->{Output} eq 'html') {
&prep_template($File, $File->{Templates}->{Error});
print $File->{Templates}->{Error}->output;
diff --git a/share/templates/en_US/fatal-error.tmpl b/share/templates/en_US/fatal-error.tmpl
index 923b39a..805676d 100644
--- a/share/templates/en_US/fatal-error.tmpl
+++ b/share/templates/en_US/fatal-error.tmpl
@@ -1,13 +1,16 @@
<TMPL_INCLUDE NAME="header.tmpl">
- <div id="main">
<TMPL_INCLUDE NAME="table.tmpl">
- <div id="result">
- <h3 id="results" class="invalid">Sorry! This document can not be checked.</h3>
+ <TMPL_IF NAME="have_warnings">
+ <TMPL_INCLUDE NAME="warnings.tmpl">
+ </TMPL_IF>
+ <h3 id="results" class="invalid">Sorry! This document can not be checked.</h3>
+<ol id="fatal-errors">
<a id="skip" name="skip"></a>
<TMPL_IF NAME="fatal_transcode_error">
+ <li class="msg_err"><span class="err_type"><img src="images/info_icons/error.png" alt="Warning" title="Error" /></span>
<p>
A fatal error occurred when attempting to transcode the character
encoding of the document. Either we do not support this character
@@ -23,9 +26,11 @@
look into supporting it in the future.
</p>
<TMPL_INCLUDE NAME="iana_charset_blurb.tmpl">
+ </li>
</TMPL_IF>
<TMPL_IF NAME="fatal_byte_error">
+<li class="msg_err"><span class="err_type"><img src="images/info_icons/error.png" alt="Warning" title="Error" /></span>
<p>
Sorry, I am unable to validate this document because on line
<strong><TMPL_VAR NAME="fatal_byte_lines"></strong>
@@ -35,9 +40,11 @@
Character Encoding). Please check both the content of the file and the
character encoding indication.
</p>
+ </li>
</TMPL_IF>
<TMPL_IF NAME="fatal_uri_error">
+<li class="msg_err"><span class="err_type"><img src="images/info_icons/error.png" alt="Warning" title="Error" /></span>
<p>
Sorry, this type of
<a href="http://www.w3.org/Addressing/">URL</a>
@@ -58,8 +65,10 @@
Remember that you can always save the page to disk and Validate it
using the File Upload interface.
</p>
+</li>
</TMPL_IF>
<TMPL_IF NAME="fatal_no_content">
+<li class="msg_err"><span class="err_type"><img src="images/info_icons/error.png" alt="Warning" title="Error" /></span>
<p>
Sorry, I could not find any content to validate. It is probable that you
clicked on the "check" button without choosing a URL, a file or entering
@@ -69,11 +78,13 @@
Read the <a href="docs/users.html">User's guide</a> for quick instructions
on using this validator.
</p>
+</li>
</TMPL_IF>
<TMPL_IF NAME="fatal_ip_error">
+<li class="msg_err"><span class="err_type"><img src="images/info_icons/error.png" alt="Warning" title="Error" /></span>
<p>
Sorry, the IP address <TMPL_IF NAME="fatal_ip_hostname">of</TMPL_IF>
<TMPL_VAR NAME="fatal_ip_host"> is
@@ -81,10 +92,12 @@
For security reasons, validating resources located at non-public IP
addresses has been disabled in this service.
</p>
+</li>
</TMPL_IF>
<TMPL_IF NAME="fatal_http_error">
+<li class="msg_err"><span class="err_type"><img src="images/info_icons/error.png" alt="Warning" title="Error" /></span>
<p>
I got the following unexpected response when trying to
retrieve &lt;<a href="<TMPL_VAR NAME="fatal_http_uri" ESCAPE="HTML">"><TMPL_VAR NAME="fatal_http_uri" ESCAPE="HTML"></a>&gt;:
@@ -99,9 +112,11 @@
domain records are correct</a>, or ask your hosting company to do so.
</p>
</TMPL_IF>
+</li>
</TMPL_IF>
<TMPL_IF NAME="fatal_mime_error">
+<li class="msg_err"><span class="err_type"><img src="images/info_icons/error.png" alt="Warning" title="Error" /></span>
<p>
Sorry, I am unable to validate this document because its content type
is <code><TMPL_VAR NAME="fatal_mime_ct" ESCAPE="HTML"></code>, which is
@@ -125,9 +140,11 @@
defining the content type) using the instructions on the
<a href="feedback.html">Feedback Page</a>.
</p>
+ </li>
</TMPL_IF>
<TMPL_IF NAME="fatal_parse_extid_error">
+<li class="msg_err"><span class="err_type"><img src="images/info_icons/error.png" alt="Warning" title="Error" /></span>
<h2>Fatal Error: <TMPL_VAR NAME="fatal_parse_extid_msg" ESCAPE="HTML"></h2>
<p>
I could not parse this document, because it makes reference to a
@@ -135,9 +152,11 @@
to specify the type of markup being used.
</p>
<TMPL_INCLUDE NAME="doctype_spiel.tmpl">
+ </li>
</TMPL_IF>
<TMPL_IF NAME="fatal_referer_error">
+<li class="msg_err"><span class="err_type"><img src="images/info_icons/error.png" alt="Warning" title="Error" /></span>
<h2><strong>No Referer header found!</strong></h2>
<p>
You have requested we check the referring page, but your browser did
@@ -154,13 +173,8 @@
<a href="detailed.html">Extended Interface</a>) to check the
page by URL.
</p>
+</li>
</TMPL_IF>
-
-<TMPL_IF NAME="have_warnings">
- <TMPL_INCLUDE NAME="warnings.tmpl">
-</TMPL_IF>
-
-</div><!-- results -->
- </div><!-- end of "main" -->
+</ol>
<TMPL_INCLUDE NAME="footer.tmpl">