Re: Backwards compatibility of new selectors

Neil St.Laurent wrote:


<<
That is right, the syntax lets you do a lot of silly things.  What
you may be thinking that /DIV P/ does is what the following would do:

/DIV //P//

However, that is equivalent to:

DIV ~ //P/
>>

No, I had figured it was _not_ intended to match multiple sibling elements.
Here's the way I had decided it must have been intended to work:

----
A sequential selector matches when an element is the first such element to
follow an arbitrary sibling.

Sequential selectors have the following syntax: a forward slash ("/")
precedes the first selector and immediately follows the second selector. The
sequential selector matches if (1) the element matched by the second
selector is the first such element to follow any element matched by the
first selector and (2) both elements have the same parent.

If there is a tilde (~) between the selectors, then the sequential selector
matches if the element matched by the second selector immediately follows
any element matched by the first selector, i.e., without any intervening
elements.
----

David Perrell

Received on Thursday, 4 December 1997 19:30:51 UTC