W3C home > Mailing lists > Public > www-style@w3.org > October 2011

Re: Selecting the parent of an element

From: Øyvind Stenhaug <oyvinds@opera.com>
Date: Fri, 07 Oct 2011 16:01:26 +0200
To: "Brian Kardell" <bkardell@gmail.com>
Cc: "Rudolph Gottesheim" <r.gottesheim@loot.at>, www-style@w3.org
Message-ID: <op.v2zikoafbunlto@oyvinds-desktop>
On Fri, 07 Oct 2011 15:21:52 +0200, Brian Kardell <bkardell@gmail.com>  

> form =.form-row input:focus { outline: solid 1px #ccc; }
> Couldn't you write that as:
> form:matches(form .form-row input:focus) { outline: solid 1px #ccc; }

No, as far as I know that selector doesn't match anything; it selects  
elements that match both the selector "form" and the selector "form  
.form-row input:focus" (i.e. any element of type "form" that also has type  
"input" and is focused and has a .form-row ancestor that in turn has a  
form ancestor).

(The point of :matches is to be able to write e.g. "A > B:matches(.foo,  
.bar) > C" instead of "A > B.foo > C, A > B.bar > C")

Øyvind Stenhaug
Core Norway, Opera Software ASA
Received on Friday, 7 October 2011 14:02:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:05 UTC