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

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
<http://annevankesteren.nl/>
<http://www.opera.com/>

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