W3C home > Mailing lists > Public > www-style@w3.org > November 1999

Re: Why no Parent Selector?

From: Daniel Glazman <Daniel.Glazman@der.edfgdf.fr>
Date: Tue, 30 Nov 1999 16:21:39 +0100 (MET)
Message-Id: <199911301521.QAA17076@cli51ak.der.edf.fr>
To: dwagner@kevric.com
Cc: www-style@w3.org
> Is there any particular reason there is no parent selector (say: <) to 
> select the parent of an element?  Putting together documents, I have come 
> across many cases where this would be handy, and one time needed a little 
> JavaScript hack to apply a style to the parent of an element, certainly not 
> the best solution for something so simple.  One example is when in a 
> paragraph I include a small piece of very important text (say a 
> SPAN.warning).  I would like to mark the entire paragraph (say with a 
> danger icon in the margin of the paragraph).  Another simple example is  to 
> draw attention to the locations of HTML editing markup, especially useful 
> when working with a long document:
> 	DEL<P, INS<P {border-left: thick red solid;}
> 
> The drawback I can think of is the style would have to be applied after the 
> UA reads the entire element to determine its contents, but this is not 
> unusual; the UA often needs to do this anyway since the overall size of a 
> block can depend on the sizes of the elements within.
> 
> If this seems like a good idea, I respectfully submit it to this forum as a 
> suggestion.

Yes it is. I think that you'll be happy reading the W3C Selectors
Working Draft [1]. It introduces the :subject selector. So selecting a
P that contains a DEL is written

	P:subject > DEL

[1] http://www.w3.org/TR/CSS3-selectors

</Daniel>
Received on Tuesday, 30 November 1999 10:21:54 GMT

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