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: Kenneth Kin Lum <kenneth.kin.lum@gmail.com>
Date: Sun, 30 Mar 2008 09:30:37 -0700
Message-ID: <d8b3b8e80803300930g38d9de2buc7475109729a87ef@mail.gmail.com>
To: "Anne van Kesteren" <annevk@opera.com>
Cc: public-html-comments@w3.org
On Sun, Mar 30, 2008 at 9:14 AM, Anne van Kesteren <annevk@opera.com> wrote:

> On Sun, 30 Mar 2008 09:09:33 -0700, Kenneth Kin Lum
> <kenneth.kin.lum@gmail.com> wrote:
> > hm... so you mean HTML take all spaces to be the content... and then...
> > it is CSS that decides to drop them?
>
> CSS can't change content. They're just not rendered by default based on
> the white-space property value.
>
>
> > So without using <pre>, is there a
>
> The <pre> element has the CSS white-space property set to presering
> whitespace (the pre value) by default. You can make it act "normally" by
> setting white-space to normal.
>
>
> > way that you could intentionally or accidentally expose the spaces by
> > defining user defined styles?
>
> Yes, as I said in my earlier e-mail, use white-space:pre.



How about without using pre, is there a way that you could intentionally or
accidentally expose the spaces by defining user defined styles?
So as far as HTML is concerned, it takes all things, including spaces, and
put them in the DOM tree, and that's done?  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?

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.  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.
Received on Sunday, 30 March 2008 16:31:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 00:13:58 GMT