Index: trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 6772)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 6773)
@@ -8,5 +8,7 @@
 import java.io.Reader;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -361,15 +363,22 @@
          */
         TestError getErrorForPrimitive(OsmPrimitive p) {
-            return getErrorForPrimitive(p, whichSelectorMatchesPrimitive(p));
-        }
-
-        TestError getErrorForPrimitive(OsmPrimitive p, Selector matchingSelector) {
+            final Environment env = new Environment().withPrimitive(p);
+            return getErrorForPrimitive(p, whichSelectorMatchesEnvironment(env), env);
+        }
+
+        TestError getErrorForPrimitive(OsmPrimitive p, Selector matchingSelector, Environment env) {
             if (matchingSelector != null && !errors.isEmpty()) {
                 final Command fix = fixPrimitive(p);
                 final String description = getDescriptionForMatchingSelector(p, matchingSelector);
+                final List<OsmPrimitive> primitives;
+                if (env.child != null) {
+                    primitives = Arrays.asList(p, env.child);
+                } else {
+                    primitives = Collections.singletonList(p);
+                }
                 if (fix != null) {
-                    return new FixableTestError(null, getSeverity(), description, null, matchingSelector.toString(), 3000, p, fix);
+                    return new FixableTestError(null, getSeverity(), description, null, matchingSelector.toString(), 3000, primitives, fix);
                 } else {
-                    return new TestError(null, getSeverity(), description, null, matchingSelector.toString(), 3000, p);
+                    return new TestError(null, getSeverity(), description, null, matchingSelector.toString(), 3000, primitives);
                 }
             } else {
@@ -407,5 +416,5 @@
             if (selector != null) {
                 check.rule.execute(env);
-                final TestError error = check.getErrorForPrimitive(p, selector);
+                final TestError error = check.getErrorForPrimitive(p, selector, env);
                 if (error != null) {
                     error.setTester(new MapCSSTagCheckerAndRule(check.rule));
