Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 8832)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 8833)
@@ -256,5 +256,5 @@
             @Override
             public void visit(Way w) {
-                if (e.child == null && left.matches(new Environment(w))) {
+                if (e.child == null && left.matches(new Environment(w).withParent(e.osm))) {
                     if (e.osm instanceof Way && Geometry.PolygonIntersection.CROSSING.equals(
                             Geometry.polygonIntersection(w.getNodes(), ((Way) e.osm).getNodes()))) {
@@ -273,5 +273,5 @@
             @Override
             public void visit(Node n) {
-                if (e.child == null && left.matches(new Environment(n))) {
+                if (e.child == null && left.matches(new Environment(n).withParent(e.osm))) {
                     if (e.osm instanceof Way && Geometry.nodeInsidePolygon(n, ((Way) e.osm).getNodes())
                             || e.osm instanceof Relation && (
@@ -284,5 +284,5 @@
             @Override
             public void visit(Way w) {
-                if (e.child == null && left.matches(new Environment(w))) {
+                if (e.child == null && left.matches(new Environment(w).withParent(e.osm))) {
                     if (e.osm instanceof Way && Geometry.PolygonIntersection.FIRST_INSIDE_SECOND.equals(
                             Geometry.polygonIntersection(w.getNodes(), ((Way) e.osm).getNodes()))
