W3C home > Mailing lists > Public > www-style@w3.org > February 2015

Re: element existence selector

From: George Bina <george@oxygenxml.com>
Date: Fri, 27 Feb 2015 17:24:26 +0200
Message-ID: <54F08C2A.9020709@oxygenxml.com>
To: www-style@w3.org
Hi,

The difference is the context element, in

e1 e2 {...}

the context is e2, while in the initial message the context is e1.

Anyway, the Selectors level 4 spec covers this, see the last example in
http://www.w3.org/TR/selectors4/#overview
***
E! > F 	an E element parent of an F element
***
and also:
http://www.w3.org/TR/selectors4/#subject

We implement this in oXygen XML Editor, for the CSS-based visual editing 
mode (Author mode)

http://oxygenxml.com/doc/ug-editor/index.html#references/dg-subject-selector.html

with the limitation that general descendant selectors are considered 
direct child selectors.
Something like
a! b c
will be processed in the same way as
a! > b > c

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 27/02/15 17:08, Brian Kardell wrote:
>
>
> On Fri, Feb 27, 2015 at 9:37 AM, Peter Krauss <ppkrauss@gmail.com
> <mailto:ppkrauss@gmail.com>> wrote:
>
>     Since CSS2 we can express the "existence of attributes",
>
>     http://www.w3.org/TR/WD-CSS2/selector.html#h-5.7.1
>
>     with the /[att]/ selector,
>
>     /    element[att] {do}/
>
>     and it is easy implement this kind of conditional selector in CSS
>     parsers...
>
>     The suggestion (or question) here is about use _the same ideia with
>     elements_, a kind of existence operator,
>
>     /    e1 <existenceOperator> e2 {do}/
>
>     to say "if element /e1/ exists, selects the /e2/ element".
>
>
>     * if it is a new suggestion, can I discuss here this subject?
>
>     * if there are /some old discussion about it/, sorry, can somebody
>     reply with a link?
>
>     ------
>     PS: I think that this kind of </existenceOperator> /can used in a
>     big subset of (imagined) applications of the problematic
>     previous-sibling-selector, and also used as a "/trigger/" in event
>     selectors, like
>            e1:hover </existenceOperator/> e2 {do}
>
>
>
>
> Can you explain how is that not just
>
>   e1 e2 {...}
>
> ?  If there is no e1, the e2 won't match.  If there is, it will.
>
>
> --
> Brian Kardell :: @briankardell :: hitchjs.com <http://hitchjs.com/>
Received on Friday, 27 February 2015 15:24:54 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:29 UTC