W3C home > Mailing lists > Public > www-style@w3.org > April 2000

Re: Extensions to CSS3 selectors

From: Jonas Sicking <sicking@bigfoot.com>
Date: Tue, 25 Apr 2000 09:17:47 +0200
Message-ID: <00c601bfae86$5baa4780$3110f7d4@Milwork08>
To: <www-style@w3.org>
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 have some suggestions for extensions to the current CSS3 selector WD:
> > >
> > >1. Empty cells
> > >Some way of selecting empty elements, my suggestion is a pseudo-class
called
> > >':empty'. This could be used to supply defaultvalues through CSS and
also
> > >functions like marking of missing data and more powerful hanling of
empty
> > >cell then the current 'empty-cells' property.
> >
> > Would you consider an element such as <HR /> as empty?  What about
> > <TEXTAREA></TEXTAREA>?
> >
> > Either way, I suggest that it's a good idea to define precisely what
> > constitutes an empty element, especially if the element is replaced.
>
> 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.

Another problem I have thought about is <E><!-- comment --></E>. I think
that this should be considerd empty, but it probobly should be mentioned in
the spec.

> I should note that Jason Orendorff [1] was the first to sugest
> this pseudo-class, but the note appeared on the www-html list before
> the topic got cross-posted to www-style
>
> [1] http://lists.w3.org/Archives/Public/www-html/2000Apr/0068.html

Sorry about this. At the time of my initial post I didn't know that this had
already been proposed.

/ Jonas Sicking
Received on Tuesday, 25 April 2000 03:17:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:04 GMT