W3C home > Mailing lists > Public > public-html-comments@w3.org > March 2008

Re: HTML 4.01 and 5.0: is it somewhat "unspecific" about space characters

From: Anne van Kesteren <annevk@opera.com>
Date: Sun, 30 Mar 2008 09:51:09 -0700
To: "Kenneth Kin Lum" <kenneth.kin.lum@gmail.com>
Cc: public-html-comments@w3.org
Message-ID: <op.t8t83jz764w2qv@annevk-t60.oslo.opera.com>

On Sun, 30 Mar 2008 09:30:37 -0700, Kenneth Kin Lum  
<kenneth.kin.lum@gmail.com> wrote:
> How about without using pre, is there a way that you could intentionally  
> or accidentally expose the spaces by defining user defined styles?

I already answered this question, no?

> So as far as HTML is concerned, it takes all things, including spaces,  
> and put them in the DOM tree, and that's done?

More or less, yes. You'd have to read the parsing algorithm in HTML5 to  
get the exact details.

> And I think I dumped out the DOM
> one time and it included all spaces and newline and whitespace  
> characters, without collapsing any whitespaces.  So I thought the white  
> space collapsing is done by the HTML part, so how come the DOM tree  
> doesn't show the
> collapsed space?

Your two statements seem to contradict each other.

> Somebody in one HTML forum on digitalpoint.com said that HTML which is a
> subset of SGML, is by default ignoring all those white spaces too.

That's false.

> So if HTML is ignoring them and don't include them, then CSS shouldn't  
> be able to get it back by setting the white-space.pre  (such as  
> dynamically in
> javascript).   So I think my question is, is HTML supposed to strip those
> white space characters as if they are not there, or is HTML supposed to  
> keep
> EVERYTHING, not stripping white spaces, not collapsing white spaces, and
> just put then in the DOM tree, and then everything else is up to the CSS
> engine.

I think I already answered this question.

Anne van Kesteren
Received on Sunday, 30 March 2008 16:51:55 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:26:24 UTC