You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Bruno Raoult <br...@gmail.com> on 2014/10/25 22:58:12 UTC

Description CSS class missing for empty desc / Missing directory description

Hi,

I am very sorry to be new on this list, and looking at the code to
understand it will take a few more days.

However, the problems I can see in mod_autoindex.c are the following (they
are related):
1) The "^^DIRECTORY^^" check for icon is not available for description. I
think Icon and Description should follow the same rules.
2) Using "IndexStyleSheet" option does not set any CSS class when
description is empty

Therefore, it is impossible (for instance) to hide the "Description" column
with pure CSS (as empty descs will have no CSS class).

I suppose this was omitted on purpose, or maybe a bug? Before going on
source code, I would like to know more about this decision to have icons
and description having different algorithms.

Thanks,

br.

-- 
2 + 2 = 5, for very large values of 2.

Re: Description CSS class missing for empty desc / Missing directory description

Posted by Bruno Raoult <br...@gmail.com>.
On Sun, Oct 26, 2014 at 12:29 AM, Bruno Raoult <br...@gmail.com> wrote:

>
> On Sat, Oct 25, 2014 at 11:53 PM, Bruno Raoult <br...@gmail.com> wrote:
>
>> May I suggest line 1785 something like:
>>            ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? "
>> class=\"indexcoldesc\">" : ">", "&nbsp;", r);
>>
>
>
I did submit a patch, via the web interface, but I am not sure I did it the
right way, and as there is no email confirmation,
I can just hope the submission was received...

The patch itself (on mod_autoindex.c):
$ diff ./generators/mod_autoindex.c ./generators/mod_autoindex.c.orig
1785c1785
<                     ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? "
class=\"indexcoldesc\">" : ">", "&nbsp;", NULL);
---
>                     ap_rputs("</td><td>&nbsp;", r);

br.

-- 
2 + 2 = 5, for very large values of 2.

Re: Description CSS class missing for empty desc / Missing directory description

Posted by Bruno Raoult <br...@gmail.com>.
On Sat, Oct 25, 2014 at 11:53 PM, Bruno Raoult <br...@gmail.com> wrote:

> May I suggest line 1785 something like:
>            ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? "
> class=\"indexcoldesc\">" : ">", "&nbsp;", r);
>

A NULL may be missing, sorry (maybe replacing "r", that I don't understand).

br.


-- 
2 + 2 = 5, for very large values of 2.

Re: Description CSS class missing for empty desc / Missing directory description

Posted by Bruno Raoult <br...@gmail.com>.
On Sat, Oct 25, 2014 at 11:34 PM, Bruno Raoult <br...@gmail.com> wrote:

> On Sat, Oct 25, 2014 at 10:58 PM, Bruno Raoult <br...@gmail.com> wrote:
>
>> Hi,
>>
>> I am very sorry to be new on this list, and looking at the code to
>> understand it will take a few more days.
>>
>> However, the problems I can see in mod_autoindex.c are the following
>> (they are related):
>> 1) The "^^DIRECTORY^^" check for icon is not available for description. I
>> think Icon and Description should follow the same rules.
>> 2) Using "IndexStyleSheet" option does not set any CSS class when
>> description is empty
>>
>> Therefore, it is impossible (for instance) to hide the "Description"
>> column with pure CSS (as empty descs will have no CSS class).
>>
>> I suppose this was omitted on purpose, or maybe a bug? Before going on
>> source code, I would like to know more about this decision to have icons
>> and description having different algorithms.
>>
>
> For (2) I believe the problem could be lines 1773-1786  (code version
> 2.4.6), and the block itself: Class is not emitted if ar[x]->desc is null
> (line 1785).
>

May I suggest line 1785 something like:
           ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? "
class=\"indexcoldesc\">" : ">", "&nbsp;", r);
instead of:
           ap_rputs("</td><td>&nbsp;", r);

Or inserting a line before the 1773 to set ar[x]->desc to "&nbsp;" if desc
null, and remove part of the following test (this seems easier to read for
me).

I am just afraid of side effects, so I would prefer somebody else to double
check :)

br.

-- 
2 + 2 = 5, for very large values of 2.

Re: Description CSS class missing for empty desc / Missing directory description

Posted by Bruno Raoult <br...@gmail.com>.
On Sat, Oct 25, 2014 at 10:58 PM, Bruno Raoult <br...@gmail.com> wrote:

> Hi,
>
> I am very sorry to be new on this list, and looking at the code to
> understand it will take a few more days.
>
> However, the problems I can see in mod_autoindex.c are the following (they
> are related):
> 1) The "^^DIRECTORY^^" check for icon is not available for description. I
> think Icon and Description should follow the same rules.
> 2) Using "IndexStyleSheet" option does not set any CSS class when
> description is empty
>
> Therefore, it is impossible (for instance) to hide the "Description"
> column with pure CSS (as empty descs will have no CSS class).
>
> I suppose this was omitted on purpose, or maybe a bug? Before going on
> source code, I would like to know more about this decision to have icons
> and description having different algorithms.
>

For (2) I believe the problem could be lines 1773-1786  (code version
2.4.6), and the block itself: Class is not emitted if ar[x]->desc is null
(line 1785).

br.

-- 
2 + 2 = 5, for very large values of 2.