Re: Extensions to CSS3 selectors

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 UTC