Page 1 of 1

Headings in body, and in div: Inconsistent format Lynx/w3m

PostPosted: 2012-03-28 08:58
by ChipOManiac
I've been doing a lot of web-designing these days. Ever since I've come across this --> http://catb.org/esr/html-hell.html, I've been extremely conscious about how my pages look to people using text-based browsers.

To make sure things show up the way they should on the browsers mentioned above (and the popular ones ;) ), I usually test on most of the browsers, and make sure everything's w3c compatible (except for experimental things in CSS :twisted: ).

While testing on lynx/w3m, I've noticed that if the headings are like so:
Code: Select all
<body>
  <h1>...</h1>
  <h2>...</h2>
  ...
  <h6>...</h6>
</body>


i.e. directly inside the body, the output is like so --> http://chipomaniac-lk.net63.net/temp/Direct.png.

Which is swell!

However, if the headings are like so:
Code: Select all
<body>
  <div>
    <h1>...</h1>
    <h2>...</h2>
    ...
    <h6>...</h6>
  </div>
</body>


i.e. inside a div, the output is like so --> http://chipomaniac-lk.net63.net/temp/InDirect.png.

There's no indentation, and the headings, regardless of their level, are aligned to the left in the same way.

Which is... freaky? :lol:

So I'd like to ask? Is this something that lynx/w3m are supposed to do? Because it just seems a little weird that headings in divs are treated differently to ones directly in the body.

Edit @ 192629 HRS of 28032012:
ELlinks seems to have no problem with this though...

Re: Headings in body, and in div: Inconsistent format Lynx/w

PostPosted: 2012-04-07 01:48
by dasein
You can thank a spammer for bringing this otherwise orphan thread to my attention.

Two things to think about:
    1) If your code is syntactically correct, then any anomalies you encounter are arguably browser bugs. And adjusting your markup to accommodate browser bugs is... um... short sighted. You can check the syntax of your code with this tool: http://validator.w3.org
    2) HTML isn't meant to control presentation and formatting. That's what CSS is for. Header tags are meant to represent something like the levels of an outline, not to control (or even influence) appearance.

Re: Headings in body, and in div: Inconsistent format Lynx/w

PostPosted: 2012-04-22 07:46
by ChipOManiac
dasein wrote:You can thank a spammer for bringing this otherwise orphan thread to my attention.

Akshually, that scares me. :shock:

dasein wrote:If your code is syntactically correct, then any anomalies you encounter are arguably browser bugs. And adjusting your markup to accommodate browser bugs is... um... short sighted. You can check the syntax of your code with this tool: http://validator.w3.org

It's perfectly syntactically (and semantically) correct, but I don't want to simply assume that it's a browser bug, nevertheless if it is going to be such a problem, I might as well.

And the validations always turn up 100%, for both HTML and CSS, unless I screw up intentionally to demoralize myself closer to suicide... :lol:

dasein wrote:HTML isn't meant to control presentation and formatting. That's what CSS is for. Header tags are meant to represent something like the levels of an outline, not to control (or even influence) appearance.

I am aware :P :lol: , the session at the web-dev forums was so hilarious, I'm sure I PML'd. I've never entered my password back there again for fear of causing them to laugh to death :lol: .

What actually seems to surprise me is that Lynx renders HTML tag attributes instead of CSS, which prolly means that CSS support is not yet implemented. :? . Which is... weird?

Thank you for replying however, I was on the verge of mailing the developers themselves. :D

Re: Headings in body, and in div: Inconsistent format Lynx/w

PostPosted: 2012-05-07 05:55
by ChipOManiac
Oh well, I went ahead and asked the developers about this little... problem? And got some answers back.

Apparently, lynx is using the w3c specification of what a div and span is, which is

The DIV and SPAN elements, in conjunction with the id and class attributes, offer a generic mechanism for adding structure to documents. These elements define content to be inline (SPAN) or block-level (DIV) but impose no other presentational idioms on the content. Thus, authors may use these elements in conjunction with style sheets, the lang attribute, etc., to tailor HTML to their own needs and tastes.

as for the change in rendering of headings:

I'm not familiar with this chunk, but reading the source it appears that lynx is making checks for the context in which the DIV is used, but none of the checks are against headers (they're against OL, UL, etc). It sets a paragraph style which is (probably...) changing the defaults used for the headers.

To "impose no other presentational idioms", in effect, lynx has to see the context in which it is used to pass information from one level to another. And the grouping would have some effect.

So apparently, if the headings are going to be rendered correctly in lynx, they need to be given some kind of semantic meaning.

The question is how? I've mailed the devs on how they're expecting the semantics to be given to something that has a generic semantic meaning.