discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Pali Rohar <pali.rohar@gmail.com>
Cc: discuss@mandoc.bsd.lv
Subject: Re: Broken tables in HTML output
Date: Sat, 1 Dec 2018 18:20:57 +0100	[thread overview]
Message-ID: <20181201172057.GD89021@athene.usta.de> (raw)
In-Reply-To: <20181126220516.nrflslyvxufb7xnk@pali>

Hi Pali,

Pali Rohar wrote on Mon, Nov 26, 2018 at 11:05:16PM +0100:
> On Monday 26 November 2018 23:01:33 Pali Rohar wrote:
>> On Monday 26 November 2018 22:58:26 Pali Rohar wrote:

>>> I tested new cvs changes for following table:

>>> .TS
>>> box;
>>> c|c|c.
>>> A	A1	A_
>>> \^	A2	\^
>>> _
>>> B	B1	B_
>>> _
>>> C	C1	C_
>>> \^	C2	\^
>>> _
>>> E	E1	E_
>>> \^	E2	\^
>>> \^	E3	\^
>>> _
>>> F	F1	F_
>>> .TE

The table syntax looks sane to me.

>>> And in chromium browser 70 there is missing horizontal line between
>>> A and B; and also between C and D. See attachment how it looks like.
>>>
>>> It is really suspicious that horizontal line is just between A2 and B1.
>>> And not across whole line.

The rendering in the PNG file you attached seems broken in multiple
respects:

 * The outer border of the table as a whole is rendered as "double",
   even though the mandoc HTML output clearly says:

   <table class="tbl" style="border-style: solid;">

 * Same for the horizontal line between B and C:

   <tr style="border-bottom-style: solid;">
     <td style="text-align: center; border-right-style: solid;">B</td>

 * Same for the horizontal line between A and B:

   <tr style="border-bottom-style: solid;">
     <td style="text-align: center; border-right-style: solid;">A2</td>
   </tr>

So whatever produced that PNG file seems quite broken.

Oh, one among the bugs in that software could be that for deciding
where to draw the borders of a row, it only looks at the <td>
elements contained in that <tr> element itself.

On https://www.w3.org/TR/html/tabular-data.html
the algorithm for processing rows says in step 13:

  Let the slots with coordinates (x, y)
  such that xcurrent <= x < xcurrent+colspan
  and ycurrent <= y < ycurrent+rowspan be covered by a new cell c,
  anchored at (xcurrent, ycurrent), which has width colspan and
  height rowspan, corresponding to the current cell element.

That implies that all slots in the second row of the table -
the row that contains A2 - are covered.  The first slot is
covered by the cell A, the third slot by the cell A_.

And right below "4.9.12. Processing model" it says:

  A row is a complete set of slots from x=0 to x=xwidth-1,
  for a particular value of y.

And https://www.w3.org/TR/CSS2/tables.html says
below "17.6.2 The collapsing border model":

  In the collapsing border model, it is possible to specify borders
  that surround all or part of a cell, row, row group, column, and
  column group.

Note that mandoc.css says "table { border-collapse: collapse; }",
so the above applies.  The whole *row* is supposed to be surrounded,
not just the <td> elements that happen to be contained in the
associated <tr> element.

Also, https://validator.w3.org/nu/ does not show any warnings
except asking for a "lang" attribute of the <html> element.

So, i believe what mandoc emits is correct and unambiguous -
if it is not, i'd appreciate clues what is wrong and how to fix it.

>>> Below is output from GNU man, which I believe is correct:
[...]

I agree that rendering is correct.
It also matches what mandoc -Tutf8 and -Tascii produce now.

>> Now I tested Firefox and Konqueror browsers too. And they rendered those
>> missing horizontal lines... Output is exactly same as like GNU man
>> terminal output.

Yes, i think Firefox renders the mandoc output correctly.

>> So it is just problem in Chromium 70?

It seems so to me, but i'm not a specialist for web technologies,
so if anyone here knows better, please speak up.

> And in all browsers I see another suspicious thing. Vertical lines in
> the middle of the table are black and horizontal lines are gray or
> rather dark gray (but not black). Border around whole table is also
> gray.
> 
> Is this intended?

No, it is not intended, all lines seem black and of equal width to me
in Firefox 62.0.2 on OpenBSD-current.

Neither the HTML emitted by mandoc nor mandoc.css makes any statement
about the color or width of the lines.  That is intentional: neither
does the tbl(7) input code, and i believe that when styling, it is
best to only style what you intend to style and leave the rest at
the default or user settings.

I don't see why any browser would render any of the lines in gray,
though, and even less so in two different colors.

  https://www.w3.org/TR/CSS2/tables.html

doesn't seem to say anything specific about color, so i'd expect

  https://www.w3.org/TR/CSS2/colors.html

to apply, which says:

  'color'
    Value:  	<color> | inherit
    Initial:  	depends on user agent 

but whatever the initial value for a root element, it should be inherited
by all children alike, as far as i can see, so the borders should be
the same color as the text.

Firing up "Web Developer >> Inspector" in Firefox 62.0.2 and enabling
"Browser Styles", i do indeed see "border-bottom-color: rgb(0, 0, 0);"
for the <table> and all its children, as expected.

So i fear i do not know how i could improve the mandoc output...

Yours,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv

  reply	other threads:[~2018-12-01 17:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 11:03 Pali Rohár
2018-07-16 15:29 ` Ingo Schwarze
2018-07-16 16:36   ` Pali Rohár
2018-07-16 17:44     ` Ingo Schwarze
2018-11-24 23:15   ` Ingo Schwarze
2018-11-25 19:34   ` Ingo Schwarze
2018-11-25 21:25     ` Ingo Schwarze
2018-11-26  8:53       ` Pali Rohár
2018-11-26 21:27   ` Ingo Schwarze
2018-11-26 21:58     ` Pali Rohár
2018-11-26 22:01       ` Pali Rohár
2018-11-26 22:05         ` Pali Rohár
2018-12-01 17:20           ` Ingo Schwarze [this message]
2018-12-01 19:35             ` Pali Rohár
2018-12-03 20:46             ` Pali Rohár
2018-12-04  5:33               ` Ingo Schwarze
2018-12-03 22:01             ` Pali Rohár
2018-12-03 22:14               ` Ingo Schwarze
2018-12-03 22:20                 ` Pali Rohár
2018-12-03 22:37                   ` Ingo Schwarze
2018-12-04 16:44                     ` Pali Rohár
2018-12-04 18:04                       ` Ingo Schwarze
2019-01-21  9:39                         ` Pali Rohár
2019-01-21 13:16                           ` Ingo Schwarze
2018-11-29  2:15     ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181201172057.GD89021@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=discuss@mandoc.bsd.lv \
    --cc=pali.rohar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).