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

Re: parent selectors

From: Dylan Schiemann <dylans@yahoo.com>
Date: Wed, 29 Nov 2000 12:09:21 -0800 (PST)
Message-ID: <20001129200921.9997.qmail@web124.yahoomail.com>
To: www-style@w3.org
> > span * < p < div {}
> 
> Question : what means then span * < p < div + foo ?
> Does it select foo ?

Under this definition, it would select foo.

> Other question : how do you select the predecessor
> of an element ?

As it exists now, E ~ F selects an F element which is
preceded by a E element.  If the use of < implied that
all rules were in reverse order, then E ~ F would mean
select an F element which precedes an element E.  This
seems to prevent being able to select E.

If a valid selector syntax allowed both > and < ,
there would propbably need to be a new symbol for a
reverse-order predecessor.  Maybe there could be a
symbol to precede any existing symbol or selector to
imply reverse order?  i.e., using ^ as this symbol

span * < p < div ^~ foo

would select the element foo which precededes the div.
 
while

span * < p < div ~ foo

would select the div element which is preceded by foo.

Then, 

span * < p < div + foo
 would select div

while

span * < p < div ^+ foo

would select foo.

and 

span * < p < div > foo

would select div which has foo and p > * span as
descendants, though this limits choosing two
descendants in this manner.

I see a few different possibilities mixing around the
examples above, but don't know if any of them are any
better than the draft.  I do think that using :subject
feels more like a special case or an afterthought than
a consistent part of the spec.

-Dylan Schiemann


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/
Received on Wednesday, 29 November 2000 15:09:26 GMT

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