Index: trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 6612)
+++ trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 6613)
@@ -38,5 +38,4 @@
 import org.openstreetmap.josm.data.validation.tests.NodesDuplicatingWayTags;
 import org.openstreetmap.josm.data.validation.tests.OpeningHourTest;
-import org.openstreetmap.josm.data.validation.tests.OverlappingAreas;
 import org.openstreetmap.josm.data.validation.tests.OverlappingWays;
 import org.openstreetmap.josm.data.validation.tests.PowerLines;
@@ -110,5 +109,4 @@
         TurnrestrictionTest.class, // ID  1801 ..  1899
         DuplicateRelation.class, // ID 1901 .. 1999
-        OverlappingAreas.class, // ID 2201 .. 2299
         WayConnectedToArea.class, // ID 2301 .. 2399
         NodesDuplicatingWayTags.class, // ID 2401 .. 2499
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingAreas.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingAreas.java	(revision 6612)
+++ 	(revision )
@@ -1,101 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.data.validation.tests;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-
-import org.openstreetmap.josm.data.osm.QuadBuckets;
-import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.data.validation.Severity;
-import org.openstreetmap.josm.data.validation.Test;
-import org.openstreetmap.josm.data.validation.TestError;
-import org.openstreetmap.josm.gui.mappaint.ElemStyles;
-import org.openstreetmap.josm.tools.Geometry;
-import org.openstreetmap.josm.tools.Predicate;
-import org.openstreetmap.josm.tools.Utils;
-
-/**
- * Checks if areas overlap.
- * @since 4448
- */
-public class OverlappingAreas extends Test {
-
-    protected static final int OVERLAPPING_AREAS = 2201;
-    protected final QuadBuckets<Way> index = new QuadBuckets<Way>();
-
-    /**
-     * Constructs a new {@code OverlappingAreas} test.
-     */
-    public OverlappingAreas() {
-        super(tr("Overlapping Areas"), tr("This test checks if areas overlap."));
-    }
-
-    @Override
-    public void visit(Way w) {
-        if (w.isUsable() && w.isArea() && ElemStyles.hasAreaElemStyle(w, false)) {
-            index.add(w);
-        }
-    }
-
-    @Override
-    public void endTest() {
-        for (final Way w : index) {
-            Collection<Way> overlaps = Utils.filter(
-                    index.search(w.getBBox()),
-                    new Predicate<Way>() {
-
-                        @Override
-                        public boolean evaluate(Way wi) {
-                            if (w.equals(wi))
-                                return false;
-                            else
-                                return Geometry.polygonIntersection(w.getNodes(), wi.getNodes())
-                                        == Geometry.PolygonIntersection.CROSSING;
-                        }
-                    });
-            if (!overlaps.isEmpty()) {
-                Collection<Way> overlapsWater = new ArrayList<Way>();
-                Collection<Way> overlapsOther = new ArrayList<Way>();
-
-                String natural1 = w.get("natural");
-                String landuse1 = w.get("landuse");
-                boolean isWaterArea = "water".equals(natural1) || "wetland".equals(natural1) || "coastline".equals(natural1) || "reservoir".equals(landuse1);
-                boolean isWaterArea2 = false;
-
-                for (Way wayOther : overlaps) {
-                    String natural2 = wayOther.get("natural");
-                    String landuse2 = wayOther.get("landuse");
-                    boolean isWaterAreaTest = "water".equals(natural2) || "wetland".equals(natural2) || "coastline".equals(natural2) || "reservoir".equals(landuse2);
-
-                    if (!isWaterArea2) {
-                        isWaterArea2 = isWaterAreaTest;
-                    }
-
-                    if (isWaterArea && isWaterAreaTest) {
-                        overlapsWater.add(wayOther);
-                    } else {
-                        overlapsOther.add(wayOther);
-                    }
-                }
-
-                if (!overlapsWater.isEmpty()) {
-                    errors.add(new TestError(this, Severity.WARNING, tr("Overlapping Water Areas"),
-                            OVERLAPPING_AREAS, Collections.singletonList(w), overlapsWater));
-                }
-
-                if (!overlapsOther.isEmpty()) {
-                    errors.add(new TestError(this, Severity.OTHER, tr("Overlapping Areas"),
-                            OVERLAPPING_AREAS, Collections.singletonList(w), overlapsOther));
-                }
-            }
-        }
-        
-        index.clear();
-
-        super.endTest();
-    }
-
-}
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj	(revision 6612)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj	(revision 6613)
@@ -81,4 +81,5 @@
 |   < FULLSTOP: "." >
 |   < ELEMENT_OF: "∈" >
+|   < CROSSING: "⧉" >
 |   < COMMENT_START: "/*" > : COMMENT
 |   < UNEXPECTED_CHAR : ~[] > // avoid TokenMgrErrors because they are hard to recover from
@@ -278,4 +279,6 @@
         |
             <ELEMENT_OF> { type = Selector.ChildOrParentSelectorType.ELEMENT_OF; }
+        |
+            <CROSSING> { type = Selector.ChildOrParentSelectorType.CROSSING; }
         )
         { selLink = new LinkSelector(conditions); }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 6612)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 6613)
@@ -39,5 +39,5 @@
 
     public static enum ChildOrParentSelectorType {
-        CHILD, PARENT, ELEMENT_OF
+        CHILD, PARENT, ELEMENT_OF, CROSSING
     }
 
@@ -150,30 +150,17 @@
         }
 
-        private class ContainsFinder extends AbstractVisitor {
-            private final Environment e;
-
-            private ContainsFinder(Environment e) {
+        private abstract class AbstractFinder extends AbstractVisitor {
+            protected final Environment e;
+
+            protected AbstractFinder(Environment e) {
                 this.e = e;
-                CheckParameterUtil.ensureThat(!(e.osm instanceof Node), "Nodes not supported");
             }
 
             @Override
             public void visit(Node n) {
-                if (e.child == null && left.matches(e.withPrimitive(n))) {
-                    if (e.osm instanceof Way && Geometry.nodeInsidePolygon(n, ((Way) e.osm).getNodes())
-                            || e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon() && Geometry.isNodeInsideMultiPolygon(n, (Relation) e.osm, null)) {
-                        e.child = n;
-                    }
-                }
             }
 
             @Override
             public void visit(Way w) {
-                if (e.child == null && left.matches(e.withPrimitive(w))) {
-                    if (e.osm instanceof Way && Geometry.PolygonIntersection.FIRST_INSIDE_SECOND.equals(Geometry.polygonIntersection(w.getNodes(), ((Way) e.osm).getNodes()))
-                            || e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon() && Geometry.isPolygonInsideMultiPolygon(w.getNodes(), (Relation) e.osm, null)) {
-                        e.child = w;
-                    }
-                }
             }
 
@@ -194,4 +181,47 @@
         }
 
+        private class CrossingFinder extends AbstractFinder {
+            private CrossingFinder(Environment e) {
+                super(e);
+                CheckParameterUtil.ensureThat(e.osm instanceof Way, "Only ways are supported");
+            }
+
+            @Override
+            public void visit(Way w) {
+                if (e.child == null && left.matches(e.withPrimitive(w))) {
+                    if (e.osm instanceof Way && Geometry.PolygonIntersection.CROSSING.equals(Geometry.polygonIntersection(w.getNodes(), ((Way) e.osm).getNodes()))) {
+                        e.child = w;
+                    }
+                }
+            }
+        }
+
+        private class ContainsFinder extends AbstractFinder {
+            private ContainsFinder(Environment e) {
+                super(e);
+                CheckParameterUtil.ensureThat(!(e.osm instanceof Node), "Nodes not supported");
+            }
+
+            @Override
+            public void visit(Node n) {
+                if (e.child == null && left.matches(e.withPrimitive(n))) {
+                    if (e.osm instanceof Way && Geometry.nodeInsidePolygon(n, ((Way) e.osm).getNodes())
+                            || e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon() && Geometry.isNodeInsideMultiPolygon(n, (Relation) e.osm, null)) {
+                        e.child = n;
+                    }
+                }
+            }
+
+            @Override
+            public void visit(Way w) {
+                if (e.child == null && left.matches(e.withPrimitive(w))) {
+                    if (e.osm instanceof Way && Geometry.PolygonIntersection.FIRST_INSIDE_SECOND.equals(Geometry.polygonIntersection(w.getNodes(), ((Way) e.osm).getNodes()))
+                            || e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon() && Geometry.isPolygonInsideMultiPolygon(w.getNodes(), (Relation) e.osm, null)) {
+                        e.child = w;
+                    }
+                }
+            }
+        }
+
         @Override
         public boolean matches(Environment e) {
@@ -223,4 +253,10 @@
                 return e.child != null;
 
+            } else if (ChildOrParentSelectorType.CROSSING.equals(type) && e.osm instanceof Way) {
+                final CrossingFinder crossingFinder = new CrossingFinder(e);
+                if (((GeneralSelector) right).matchesBase(OsmPrimitiveType.WAY)) {
+                    crossingFinder.visit(e.osm.getDataSet().searchWays(e.osm.getBBox()));
+                }
+                return e.child != null;
             } else if (ChildOrParentSelectorType.CHILD.equals(type)) {
                 MatchingReferrerFinder collector = new MatchingReferrerFinder(e);
