Re: Ignoring empty paragraphs

From: "L. David Baron" <dbaron@fas.harvard.edu>
Date: Tue, Apr 11, 2000, 9:45 AM

> On Tue, 11 Apr 2000 13:46:07 -0700, Matthew Brealey
> (webmaster@richinstyle.com) wrote:
>>
>> > >it introduces a gap of about 1em, depending on your browser's
>> > >setting for margins on <p>.
>> >
>> > It does _not_ in Mozilla M14 "strict" mode.
>> > (yes, I did try exactly your line up here before posting :)
>>
>> That's a bug - it doesn't ignore the Ps here:
>>
>> http://richinstyle.com/test/application/sibling2.html
>>
>> so by any interpretation of the spec this is wrong.
>
> As I said in my original post [1], Mozilla's current approach is
> between the two I described.  I believe the current implementation is
> that the empty P elements are put into the DOM tree and the CSS layout
> code has special rules built in for HTML P elements.  (These rules
> don't lead to completely ignoring empty p elements, since a "<p></p>"
> in the middle of a block still does cause a line break).

Tasman similarly puts empty P elements into the DOM tree and has special CSS
layout code to "ignore" empty P elements.

Similarly, empty P elements take part in adjacent sibling selector matching in
Tasman.

> I'm not sure
> that one can argue that this is wrong, considering the vagueness of the
> statement mentioned in [1] from section 9.3.1 of HTML.

Agreed.

> I don't really like this behavior either.  However, without an
> authoritative statement from the authors of that statement about it's
> intent (as Braden mentioned in [2]), I don't think I'd be able to (or
> should) convince others to change this behavior.

I'll go beyond that - I'm fully convinced that the HTML4 spec intended that
empty P elements be ignored purely from a presentation perspective (face it -
there's tons of presentation related perspective in HTML4 - it's not just a
structural "markup" spec).

If it does turn out that the original intent was that empty P elements were
supposed to be ignored in the parser, then this is a bug in HTML4 spec which
needs to be fixed.  Fortunately, no such bug exists in XHTML.

Tantek

----------------------------------------------------------------------------
Want standards? Have you validated your HTML today?  http://validator.w3.org

Received on Tuesday, 11 April 2000 13:33:23 UTC