Welcome to WebHeadStart.org

Web Technologies

Sponsored By

WebHeadStart.org is currently in beta.
Please pardon our appearance as we work to provide you with the most comprehensive reference on today's web technologies.

Interested in advertising on WebHeadStart? Become an advertising partner today!

[WWW-HTML Mailing List Archive Home] [Messages By Thread] [Messages By Date]

Re: XHTML (was Re: Wrapping paragraph text around blocks)

From: J. King <mtknight@dark-phantasy.com>
Date: Fri, 25 Mar 2005 10:25:28 -0500
To: www-html <www-html@w3.org>
Message-ID: <op.sn684qvpk4suho@briann>

On Fri, 25 Mar 2005 09:41:58 -0500, Edward Lass <elass@goer.state.ny.us>
wrote:

> Regarding the p element, IE's tag soup parser has no problem ignoring
> the XML trailing slashes, which it doesn't regard as any sort of valid
> construct. The same would happen in this situation. The major browser
> will get the semantics wrong, but the content will still come across. I
> don't think the sky would fall.

I think you midunderstand.  Browsers use HTML parsers for the content type
text/html (and IE doesn't doesn't have any other viable option when it
comes to XHTML).  HTML 4.01 allows the implied closure of the <p> element
when it's followed by a block-level element because its content model is
strictly inline.  Hence, to current HTML browsers, this:

<p>This is a paragraph
   <ul><li>which contains a list</li></ul>
</p>

would in practice be parsed as this:

<p>This is a paragraph</p>
<ul><li>which is followed by a list</li></ul>

This would cause problems for both document-manipulating scripts and CSS,
since the selectors 'p ul' or 'p>ul' would never work and
p.getElementsByTagName('ul') wouldn't return any elements.

-- 
J. King
http://jking.dark-phantasy.com/ 
Received on Friday, 25 March 2005 15:25:32 GMT
Valid XHTML 1.0! Valid CSS! Site Map | Privacy Policy | Terms of Use | WebHeadStart.org © 2005 All Rights Reserved.