[css-d] Select by descendant?

2014-05-16 Thread BPJ
is it possible to select an element based on the presence or absence of a
descendant with some attribute?

/bpj
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Select by descendant?

2014-05-16 Thread MiB

may 16 2014 11:53 BPJ b...@melroch.se:

 is it possible to select an element based on the presence or absence of a
 descendant with some attribute?


AFAIK it’s not possible to select a parent element based on its descendant, no.

Can you describe a specific example? Do you control the HTML source?
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Select by descendant?

2014-05-16 Thread Colin (Sandy) Pittendrigh
You can with X-Path in XML.  No reason why it shouldn't be possible
eventually--as part of CSS.  And many reasons why it should


On Fri, May 16, 2014 at 5:06 AM, MiB digital.disc...@gmail.com wrote:


 may 16 2014 11:53 BPJ b...@melroch.se:

  is it possible to select an element based on the presence or absence of a
  descendant with some attribute?


 AFAIK it's not possible to select a parent element based on its
 descendant, no.

 Can you describe a specific example? Do you control the HTML source?
 __
 css-discuss [css-d@lists.css-discuss.org]
 http://www.css-discuss.org/mailman/listinfo/css-d
 List wiki/FAQ -- http://css-discuss.incutio.com/
 List policies -- http://css-discuss.org/policies.html
 Supported by evolt.org -- http://www.evolt.org/help_support_evolt/




-- 
/*  Colin (Sandy) Pittendrigh  --oO0 */
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Select by descendant?

2014-05-16 Thread Brian Kardell
CSS selectors level 4 introduces a :has() pseudo class, but it isn't out
there and even when it is it will (initially at least) only be supported in
the complete profile - meaning it will work via querySelectorAll and
friends, but not CSS itself.

If you only, need this in script, jQuery has had :has from the beginning
(it was a proposal from CSS3 a decade and a half ago), and if you need it
in CSS you might have a look at hitchjs which has it
On May 16, 2014 5:53 AM, BPJ b...@melroch.se wrote:

 is it possible to select an element based on the presence or absence of a
 descendant with some attribute?

 /bpj
 __
 css-discuss [css-d@lists.css-discuss.org]
 http://www.css-discuss.org/mailman/listinfo/css-d
 List wiki/FAQ -- http://css-discuss.incutio.com/
 List policies -- http://css-discuss.org/policies.html
 Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Select by descendant?

2014-05-16 Thread MiB

may 16 2014 14:25 Brian Kardell bkard...@gmail.com:

 If you only, need this in script, jQuery has had :has from the beginning
 (it was a proposal from CSS3 a decade and a half ago), and if you need it
 in CSS you might have a look at hitchjs which has it


I suppose that if you are already using jQuery you could make a script add a 
class or whatever to the parent element.  While this is cheating (:-P) it will 
work unless Javascript is inactive.
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Select by descendant?

2014-05-16 Thread MiB

may 16 2014 13:59 Colin (Sandy) Pittendrigh sandy.pittendr...@gmail.com:

 X-Path in XML

Is this viable for browser solutions with HTML5? I’m not familiar with X-path 
outside of Java, which I only use at the server.
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Select by descendant?

2014-05-16 Thread Tom Livingston
On Fri, May 16, 2014 at 9:47 AM, MiB digital.disc...@gmail.com wrote:

 may 16 2014 14:25 Brian Kardell bkard...@gmail.com:

 If you only, need this in script, jQuery has had :has from the beginning
 (it was a proposal from CSS3 a decade and a half ago), and if you need it
 in CSS you might have a look at hitchjs which has it


 I suppose that if you are already using jQuery you could make a script add a 
 class or whatever to the parent element.  While this is cheating (:-P) it 
 will work unless Javascript is inactive.
 __


I was thinking the same thing. If it's just an aesthetic tweak and not
a critical usability fix, I'd say it's pretty harmless.

-- 

Tom Livingston | Senior Front-End Developer | Media Logic |
ph: 518.456.3015x231 | fx: 518.456.4279 | mlinc.com
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Select by descendant?

2014-05-16 Thread Brian Kardell
On May 16, 2014 9:47 AM, MiB digital.disc...@gmail.com wrote:


 may 16 2014 14:25 Brian Kardell bkard...@gmail.com:

  If you only, need this in script, jQuery has had :has from the beginning
  (it was a proposal from CSS3 a decade and a half ago), and if you need
it
  in CSS you might have a look at hitchjs which has it


 I suppose that if you are already using jQuery you could make a script
add a class or whatever to the parent element.  While this is cheating
(:-P) it will work unless Javascript is inactive.


That will get you the basic onload of it, sure.  If you wanted it in css
though then you want to maintain that class appropriately (if the :has
ceases to apply at any time or starts to) and that's more work... That's
what hitch does, and let you write it in CSS...  Also to use it like you
would and find out if it's really as useful/intuitive as you imagine and,
hopefully, provide feedback to www-st...@w3.org (css working group) -
extensiblewebmanifesto.org

__
 css-discuss [css-d@lists.css-discuss.org]
 http://www.css-discuss.org/mailman/listinfo/css-d
 List wiki/FAQ -- http://css-discuss.incutio.com/
 List policies -- http://css-discuss.org/policies.html
 Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/