- From: Jonas Sicking <sicking@bigfoot.com>
- Date: Tue, 25 Apr 2000 23:55:00 +0200
- To: <www-style@w3.org>
On Tuesday, April 25 2000 Ian Graham wrote > On Tue, 25 Apr 2000, Jonas Sicking wrote: > > On Sunday, April 23 2000, Ian Graham wrote > > > > > On Sat, 22 Apr 2000, Tim Bannister wrote: > > > > > > > On Fri, 21 Apr 2000, Jonas Sicking wrote: > > > > > > > I would suggest (see [1]) the following specification: > > > > > > :empty The Empty-Element Pseudo-Class. > > > > > > The empty-element pseudo classes matches elements that are empty > > > of significant content. In this context, "empty of significant > > > content" has the following meanings depending on how the markup > > > is being processed: > > > > > > 1) If the data are being processed by an HTML processor, then an > > > element is empty of significant content if: > > > (a) The element is an HTML element declared to be empty, or > > > (b) The element consists of a start and stop tag, but the > > > content of the element consists only of zero or more > > > white space characters. White space > > > characters are defined as in production 3 of the > > > XML 1.0 specification, namely: > > > (#x20 | #x9 | #xD | #xA)+ > > > > > > 2) If the data are being processed by an XML processor, then > > > an element is empty of significant content if: > > > (a) The element is written as an empty-element tag, or > > > (b) The element consists of a start and stop tag, but the > > > content of the element consist only of zero or more > > > XML white space characters. > > > > Should whitespace only really be considered insignifican if the element is > > declared to be whitespace preserving? In xhtml (and therefor html?) the > > think the style, script and pre elements are declared to preseve whitespace. > > In XML any tag could be declared to preseve whitespace. > > That's a good point. My first though is that, if xml:space="default", then > such elements may or may not become empty after processing (depending on > the way the application deals with white space), so that treating both > cases as 'empty' means that rendering will be the same regardless of how > the processor handles the XML data. IMHO this is the desired behavior. > > It's less obvious with xml:space="preserve". HOwever, in this case I would > argue that rules such as > > elem:space[xml:space=default] { one set of rules} > elem:space[xml:space=preserve] { another set of rules} > > would let you deal with this situation, while preserving the idea that > :empty means 'empty' in the expected sense. What do you mean by "expected sence"? IMHO <E xml:space="preserve"> </E> should NOT qualify as empty since I think that setting xml:space="preserve" means that white-space characters should be treated as normal characters. When setting "preserve" you have to be extra careful that you don't produce any extra whitespace since it will probobly affect the end resault. For example, should this really be considered empty? <PRE> </PRE> How does the DOM handle this? When are textnodes created? does xml:space affect this? / Jonas Sicking
Received on Tuesday, 25 April 2000 17:54:41 UTC