Index: src/org/openstreetmap/josm/gui/mappaint/Environment.java
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/Environment.java	(revision 4008)
+++ src/org/openstreetmap/josm/gui/mappaint/Environment.java	(working copy)
@@ -1,14 +1,25 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.mappaint;
 
+import java.util.List;
+
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction;
+import org.openstreetmap.josm.gui.mappaint.mapcss.Selector;
 
 public class Environment {
-    
+
     public OsmPrimitive osm;
     public MultiCascade mc;
     public String layer;
     public StyleSource source;
+    /**
+     * <p>after the selectors of a MapCSS rule have been applied to {@code osm}, the matching
+     * parent objects of {@code osm} are remembered in this field. It can be accessed in
+     * {@link Instruction#execute(Environment)} to access tags from parent objects.</p>
+     * 
+     */
+    public List<OsmPrimitive> matchingReferrers = null;
 
     public Environment(OsmPrimitive osm, MultiCascade mc, String layer, StyleSource source) {
         this.osm = osm;
@@ -17,4 +28,11 @@
         this.source = source;
     }
 
+    public void setMatchingReferrers(List<OsmPrimitive> refs) {
+        matchingReferrers = refs;
+    }
+
+    public void forgetMatchingReferrers() {
+        this.matchingReferrers = null;
+    }
 }
Index: src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java	(revision 4008)
+++ src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java	(working copy)
@@ -16,7 +16,6 @@
 import org.openstreetmap.josm.actions.search.SearchCompiler.Match;
 import org.openstreetmap.josm.actions.search.SearchCompiler.ParseError;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.gui.mappaint.Cascade;
 import org.openstreetmap.josm.gui.mappaint.Environment;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -173,9 +172,15 @@
                 return env.osm.get(key);
             }
 
-            // FIXME: respect parent selector chain
             public String parent_tag(String key) {
-                for (Relation parent: OsmPrimitive.getFilteredList(env.osm.getReferrers(), Relation.class)) {
+                if (env.matchingReferrers == null) {
+                    for (OsmPrimitive parent : env.osm.getReferrers()) {
+                        String value = parent.get(key);
+                        if (value != null) return value;
+                    }
+                    return null;
+                }
+                for (OsmPrimitive parent: env.matchingReferrers) {
                     String value = parent.get(key);
                     if (value != null) return value;
                 }
Index: src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 4008)
+++ src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(working copy)
@@ -1,6 +1,7 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.openstreetmap.josm.data.osm.Node;
@@ -14,20 +15,45 @@
 import org.openstreetmap.josm.tools.Utils;
 
 public interface Selector {
-    
+
     public boolean applies(Environment e);
 
     public String getSubpart();
     public Range getRange();
 
+    /**
+     * <p>Despite its name represents a <em>child selector</em>. JOSM doesn't support
+     * descendant selectors yet.</p>
+     * 
+     * <p>In addition to the standard CSS notation for child selectors, JOSM also supports
+     * an "inverse" notation:</p>
+     * <pre>
+     *    // the standard notation:
+     *    parentselector > childselector { ... }
+     * 
+     *    // the inverse notation:
+     *    childselector < parentselector { ... }
+     * </pre>
+     *
+     */
     public static class DescendentSelector implements Selector {
         Selector a, b;
-        boolean child;
+        /** true, if this represents a child selector in inverse notation
+         * {@code childselector < parentselector}
+         */
+        boolean inverseNotation;
 
+        /**
+         * 
+         * @param a the first selector
+         * @param b the second selector
+         * @param child if true {@code a} is the child selector; otherwise, {@code a}
+         * is the parent selector
+         */
         public DescendentSelector(Selector a, Selector b, boolean child) {
             this.a = a;
             this.b = b;
-            this.child = child;
+            this.inverseNotation = !child;
         }
 
         @Override
@@ -36,12 +62,20 @@
                 return false;
 
             Environment e2 = new Environment(null, e.mc, e.layer, e.source);
-            if (child) {
+            List<OsmPrimitive> matchingRefs = new ArrayList<OsmPrimitive>();
+            if (!inverseNotation) {
+                boolean foundMatchingReferrer = false;
                 for (OsmPrimitive osm : e.osm.getReferrers()) {
                     e2.osm = osm;
-                    if (a.applies(e2))
-                        return true;
+                    if (a.applies(e2)) {
+                        matchingRefs.add(osm);
+                        foundMatchingReferrer = true;
+                    }
                 }
+                if (foundMatchingReferrer) {
+                    e.setMatchingReferrers(matchingRefs);
+                    return true;
+                }
             } else {
                 if (e.osm instanceof Relation) {
                     for (OsmPrimitive chld : ((Relation) e.osm).getMemberPrimitives()) {
Index: src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 4008)
+++ src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(working copy)
@@ -139,6 +139,7 @@
         Environment env = new Environment(osm, mc, null, this);
         for (MapCSSRule r : rules) {
             for (Selector s : r.selectors) {
+                env.forgetMatchingReferrers();
                 if (s.applies(env)) {
                     if (s.getRange().contains(scale)) {
                         mc.range = Range.cut(mc.range, s.getRange());
