Re: Extensions to CSS3 selectors

Ian Graham wrote:
> On Tue, 25 Apr 2000, Jonas Sicking wrote:
> > <E xml:space="preserve">   </E>
> > should NOT qualify as empty since I think that setting
> > means that white-space characters should be treated as normal
> > When setting "preserve" you have to be extra careful that you don't
> > 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
> The DOM doesn't say how and when text nodes should be created -- it simply
> assumes that they do or don't exist. As far as I know this is the domain
> of the overall application, which can choose (if xml:space="default") to
> discard white space, if it deems this to be the 'better' choice [1]. This
> means that the situation is essentially undetermined unless you explicitly
> set xml:space="preserve" in the document.  Note that a non-validating
> parser will make no assumptions about the value for xml:space unless it is
> explicitly set for an element. Notably it is _not_ globally set for the
> XHTML 1.0 DTDs (it is set for script, style, and pre elements) [2]. But, a
> nonvalidating parser will not know this, and can still do what it wants
> ...  Thus default can mean either preserve or dont .. which is
> somewhat confusing, to say the least...
> For example, the MSXML processor will by default prune text nodes
> containing only white space from the DOM tree. Thus the markup <a> </a>
> becomes an element node with no text node child. However, the MSXML
> processor will _preserve_ this text node if you set a processor parameter
> (processorObjName.preserveWhiteSpace = 1 ). I believe it will also
> preserve this text node if you explicitly set xml:space="preserve", but
> haven't tested this. Nav6, on the other hand, preserves white space by
> default.
> But I see the problem you are raising -- that, if I set
> xml:space="preserve" then I am really saying that whitespace is real
> content, and I don't want my CSS to think it's empty.  In that case, it
> might be better to change the proposal so that :empty does not match
> elements that have xml:space="preserve" and that contain child nodes of
> any type.
> Does that seem more reasonable?
> [1]
> [2] (and therein)

This seems perfect IMHO : )

/ Jonas Sicking

Received on Wednesday, 3 May 2000 18:45:33 UTC