Hi Francis, First of all, thanks for your research and well backed answer. Here I go: On Tue, 27 Apr 2004, Francis Daly wrote:
On Mon, Apr 26, 2004 at 07:48:11PM -0400, Jorge Arellano Cid wrote:
On Thu, 22 Apr 2004, Jens Arm wrote:
Please test our current CVS hardly, and tell us how it did.
Directories like
http://fy.chalmers.se/~appro/linux/DVD+RW/tools/
or others are not rendered correctly
Yes. This is a complex problem.
Apache (the web server), generates bad HTML for directory listings (at least 1.3.x series):
<PRE> is an inline container excluding:
{IMG, OBJECT, APPLET, BIG, SMALL, SUB, SUP, FONT, BASEFONT}
Also, it can't hold block elements (e.g. HR).
So there's a bug in having <HR> inside <PRE> and one bug per directory entry because <PRE> can't contain <IMG>.
<q from above URL> Yes, it's a known issue. In 2.0 and later, tables can be enabled by configuration. 1.3 will stick with the <pre> stuff, also because of backwards compat, sorry. <q>
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13351 suggest that the apache developers know, and it's not going to change in the 1.3 series.
Well, they know the bad HTML issue and made a tables version for the directory listing (that was also faulty but that as of the bug entry should be corrected now).
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10880 suggests that the default won't change in the 2.0 series,
<q from above URL> Item 1 has been fixed in 2.1 and is proposed for backport. Item 2 ... ehm? what standard? html? agreed. ;-) As said you can use IndexOptions to fix that issues. For backwards compat we should stick with the current defaults. Item 3 doesn't appear in the current tree so I'm assuming it fixed already. </q> The backwards compatibility is a point that was easy to foresee. Although the developer above doesn't seem to be much concerned about the standards, and this surprises me. A simple solution woud be to replace: -<HR> +</PRE><HR><PRE> and replece the <IMG> tag with its alt text, and make _that_ the default in apache. They could provide an option to produce the old directory listing, and thus, leave the responsibility of deciding whether to serve bad HTML to every webmaster, but the default should be valid HTML (IMHO). In brief, the webmaster would have: - Good HTML by default (no images) based on <PRE> - The option to serve bad HTML with images based on <PRE> - The option to serve good HTML with images based on <TABLE>
After analizing the produced HTML for directory listings, I found that isolating the <HR> outside <PRE> is a trivial fix that helps keeping the block element outside.
That is:
- <HR> + </PRE><HR><PRE>
Very simple. It would allow for violations of the type "inline container with excluded inline element within" (instead of "inline container with a block inside").
Does anyone know an apache developer? It seems that sending the patch through bugzilla could take years to be noticed...
It can be a bit hit and miss. If one of the core team is directly interested and not otherwise engaged, they can get things done quickly.
I got a bit discouraged to make the patch and submit it because it's a toilsome work that I don't know will have a warm reception ;) If you feel like doing it, please go ahead, but I'd suggest first to contact one of the developers and explain the idea before making a patch. It's reasonable, unless they have to support some scripts that rely on the directory listing source being served exactly the old way...
Their most recent attempt not to lose patches seems to be described in http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=108012889313136&w=2 which suggests that bugzilla may be being watched closely.
This is good news. But the whole issue is more a "backwards compatibilty" problem than "valid HTML". This is better to be asked in advance.
OTOH, I don't like very much breaking our policies with code to handle bad HTML, and yes I know this is the most used web server. Maybe a dillorc option to enable a workaround for apache could do it, but I'd really like to talk with one of the developers.
Comments?
As others have said, any future change to apache won't change current servers for years to come.
Sigh, I suppose this is right. Even under the pressure of a security-fix release...
So rendering it usefully, if not ideally, would be prudent. And a big black mark in the bug meter is in order, too.
Correctness vs usefulness...
Yes Francis, I think the same as you, but I'd appreciate if someone asks them if serving good HTML without the images for the directory listing is a good default (providing the alternatives described above). For those that read this far: the CVS contains the patch I made for this issue. Cheers Jorge.-